View Source opentelemetry_xray_propagator (opentelemetry_xray v0.7.4)
Propagator that injects and extracts context from the AWS X-Ray tracing header.
When the current app is downstream from another app or the AWS load balancer, the upstream app creates the trace for the current request and sends it in the "X-Amzn-Trace-Id" HTTP header. The header includes the trace id and optional information about the parent span and sampling.
Similarly, when the current app makes calls to downstream services, it sets the header to pass the current trace context.
NOTE: Amazon assumes that spans are not sampled by default. If you want your traces to be sampled, make sure that you turn it on.
https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader
Summary
Functions
Encode span_id to string.
Encode trace_id to string.
Extract context from carrier.
Return list of the keys the propagator sets with inject
.
Inject context into carrier.
Functions
-spec encode_span_id(non_neg_integer()) -> unicode:latin1_chardata().
Encode span_id to string.
-spec encode_trace_id(opentelemetry:span_ctx() | non_neg_integer()) -> unicode:latin1_chardata().
Encode trace_id to string.
-spec extract(Context, Carrier, CarrierKeysFun, CarrierGetFun, Options) -> Context when Context :: otel_ctx:t(), Carrier :: otel_propagator:carrier(), CarrierKeysFun :: otel_propagator_text_map:carrier_keys(), CarrierGetFun :: otel_propagator_text_map:carrier_get(), Options :: otel_propagator_text_map:propagator_options().
Extract context from carrier.
Return list of the keys the propagator sets with inject
.
-spec inject(Context, Carrier, CarrierSetFun, Options) -> Carrier when Context :: otel_ctx:t(), Carrier :: otel_propagator:carrier(), CarrierSetFun :: otel_propagator_text_map:carrier_set(), Options :: otel_propagator_text_map:propagator_options().
Inject context into carrier.