Expand description
OpenTelemetry trace context helpers for HTTP headers
Provides W3C Trace Context propagation with optional OpenTelemetry integration.
- With
otelfeature: Uses proper OTEL propagators for distributed tracing - Without
otelfeature: No-op implementations (graceful degradation)
Constants§
- TRACEPARENT
- W3C Trace Context header name
Functions§
- get_
traceparent - Extract traceparent header value from HTTP headers
- inject_
current_ span - Inject current OpenTelemetry context into HTTP headers. Uses the global propagator to inject W3C Trace Context.
- parse_
trace_ id - Parse trace ID from W3C traceparent header (format: “00-{trace_id}-{span_id}-{flags}”)
- set_
parent_ from_ headers - Set span parent from W3C Trace Context headers. Extracts the trace context and sets it as the parent of the given span.