otel_propagator_text_map
that injects and
extracts trace context using the B3 specification from Zipkin.
Behaviours: otel_propagator_text_map.
An implementation of otel_propagator_text_map
that injects and
extracts trace context using the B3 specification from Zipkin.
Since trace_context
and baggage
are the two default propagators the
global TextMap Propagators must be configured if B3 is to be used for
propagation:
{text_map_propagators, [b3, baggage]},
To use B3 multi-header format use:
{text_map_propagators, [b3multi, baggage]},
CompositePropagator = otel_propagator_text_map_composite:create([b3, baggage]), opentelemetry:set_text_map_propagator(CompositePropagator).
It is also possible to set a separate list of injectors or extractors. For example, if the service should extract B3 encoded context but you only want to inject context encoded with the W3C TraceContext format (maybe you have some services only supporting B3 that are making requests to your server but you have no reason to continue propagating in both formats when communicating to other services further down the stack). In that case you would instead set configuration like:
{text_map_extractors, [b3, trace_context, baggage]}, {text_map_injectors, [trace_context, baggage]},
Or using calls to opentelemetry
at runtime:
B3CompositePropagator = otel_propagator_text_map_composite:create([b3, trace_context, baggage]), CompositePropagator = otel_propagator_text_map_composite:create([trace_context, baggage]), opentelemetry:set_text_map_extractor(B3CompositePropagator), opentelemetry:set_text_map_injector(CompositePropagator).
extract/5 | |
fields/1 | |
inject/4 |
extract(Context, Carrier, CarrierKeysFun, CarrierGetFun, Options) -> Context
fields(X1) -> any()
inject(Context, Carrier, CarrierSetFun, Options) -> Carrier
Generated by EDoc