View Source otel_propagator behaviour (opentelemetry_api v1.2.2)

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 for otel_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.
jaeger
-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(t(), carrier()) -> carrier().
-callback inject_from(otel_ctx:t(), t(), carrier()) -> carrier().
extracts values from a carrier and sets them in the context

Link to this section Functions

Link to this function

builtin_to_module(Module)

View Source
-spec builtin_to_module(builtin() | module() | {module(), term()}) -> module() | {module(), term()}.
Link to this function

builtins_to_modules(Propagators)

View Source
-spec builtins_to_modules([t()]) -> [module() | {module(), term()}].