Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init bootstraps the OpenTelemetry TracerProvider.
When OTEL_ENABLED is "true" it connects an OTLP/gRPC exporter to the collector at OTEL_EXPORTER_OTLP_ENDPOINT (default: localhost:4317) and registers a BatchSpanProcessor. All standard OTEL_* env vars (endpoint, headers, TLS, etc.) are respected automatically by the SDK.
When OTEL_ENABLED is missing or any other value, a no-op TracerProvider is installed so the rest of the code can call otel.Tracer() safely without branching.
It returns a shutdown function that must be called before the process exits (e.g. deferred in main) to flush buffered spans.
func TraceIDFromContext ¶
TraceIDFromContext extracts the W3C trace ID and span ID from the current span in ctx. Returns empty strings when there is no active span.
Types ¶
This section is empty.