Documentation
¶
Overview ¶
Package tracing wires OpenTelemetry distributed tracing for Fiber apps: it builds an OTLP/HTTP tracer provider (configured by the standard OTEL_ env vars), installs it and the W3C propagator as the OTel globals, and returns a shutdown function for graceful shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogFields ¶
LogFields returns the trace and span IDs from ctx's span context. ok is false when ctx carries no valid span context.
func Setup ¶
Setup builds an OTLP/HTTP tracer provider, installs it and the W3C trace context + baggage propagator as the OTel globals, and returns a shutdown function that flushes and stops the provider. Exporter endpoint and headers come from the standard OTEL_ env vars (e.g. OTEL_EXPORTER_OTLP_ENDPOINT).
Types ¶
type Option ¶
type Option func(*config)
Option configures tracer setup.
func WithSampler ¶
WithSampler overrides the default ParentBased(AlwaysSample) sampler.
func WithServiceName ¶
WithServiceName sets the resource service.name used when OTEL_SERVICE_NAME is not set in the environment.