Documentation
¶
Overview ¶
Package telemetry configures OpenTelemetry tracing for dfetch. Tracing is off by default: instrumentation creates spans against the global no-op TracerProvider and costs almost nothing until Setup installs a real provider, which only happens when an OTLP endpoint is configured via the environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enabled ¶
func Enabled() bool
Enabled reports whether OTLP tracing is configured via the environment. Tracing turns on only when an OTLP endpoint is set (and not explicitly disabled), so running dfetch without those vars emits no traces.
func Setup ¶
func Setup(ctx context.Context, serviceVersion string) (shutdown func(context.Context) error, err error)
Setup installs a global TracerProvider exporting over OTLP/HTTP when tracing is Enabled, and returns a shutdown func that flushes pending spans. When tracing is not enabled it installs nothing and returns a no-op shutdown.
Types ¶
This section is empty.