View Source otel_propagator behaviour (opentelemetry_api v1.3.0)
A Propagator injects or extracts data from a Context so information like baggage and trace context can be transported along with cross service requests, like an HTTP request.
Propagators are defined based on the type of encoding they inject and extract. At this time there is only a TextMapPropagator, otel_propagator_text_map
, which works on ASCII keys and values.
This behaviour is only for defining the callbacks used by each propagator per type and is only used by developers adding a new type of propagator (like for binary protocols), not implementations of propagators themselves (like B3 or W3C TraceContext).
Users configure and call propagators based on their type. See the docs forotel_propagator_text_map
for more details.
Link to this section Summary
Callbacks
extracts values from a carrier and sets them in the context
Link to this section Types
-type builtin() :: trace_context | tracecontext | b3 | b3multi | baggage.
-type carrier() :: term().
-type t() :: builtin() | module() | {module(), term()}.
Link to this section Callbacks
-callback extract(t(), carrier()) -> otel_ctx:t() | otel_ctx:token().
-callback extract_to(otel_ctx:t(), t(), carrier()) -> otel_ctx:t().
-callback inject_from(otel_ctx:t(), t(), carrier()) -> carrier().