Documentation
¶
Overview ¶
Package telemetry sets up OpenTelemetry tracing for Stampede itself. Tracing is off unless the standard OTEL_EXPORTER_OTLP_ENDPOINT (or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) environment variable is set; then spans are exported over OTLP, using gRPC when OTEL_EXPORTER_OTLP_PROTOCOL (or ..._TRACES_PROTOCOL) is "grpc" and HTTP/protobuf otherwise. The other standard variables (headers, sampler, service name, resource attributes) are honoured by the OpenTelemetry SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Protocol ¶
func Protocol() string
Protocol returns the configured OTLP protocol for traces: "grpc" or "http/protobuf" (the default).
func Setup ¶
func Setup(ctx context.Context, service, version string) (shutdown func(context.Context) error, err error)
Setup installs a global tracer provider exporting over OTLP when an endpoint is configured, and the W3C trace context propagator. It returns a function that flushes and stops the exporter. Without an endpoint it changes nothing and the returned function is a no-op.
Types ¶
This section is empty.