Skip to main content

Module otel

Module otel 

Source
Expand description

OpenTelemetry trace context helpers for HTTP headers

Provides W3C Trace Context propagation with optional OpenTelemetry integration.

  • With otel feature: Uses proper OTEL propagators for distributed tracing
  • Without otel feature: 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
No-op: OpenTelemetry is disabled
parse_trace_id
Parse trace ID from W3C traceparent header (format: “00-{trace_id}-{span_id}-{flags}”)
set_parent_from_headers
No-op: OpenTelemetry is disabled Records trace IDs if present in headers for log correlation only.