lens.propagation
W3C TraceContext / Baggage propagation helpers.
Module Contents
Functions
API
Extract span context from carrier and return an OTel Context.
Use this to resume a distributed trace from incoming headers/metadata.
Parameters:
carrier
A dict containing W3C traceparent (and optionally
tracestate, baggage) headers.
Returns: context.Context
An OTel Context. If no valid trace context is present the returned
Inject the current span context into carrier (W3C TraceContext + Baggage).
Use this to propagate trace context across process boundaries, e.g. into HTTP header dicts or gRPC metadata.
Parameters:
carrier
A mutable dict that will receive the traceparent
(and optionally tracestate, baggage) headers.