View Source opentelemetry_xray_propagator (opentelemetry_xray v0.7.2)

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

Link to this section Summary

Functions

Encode span_id to string.
Encode trace_id to string.
Return list of the keys the propagator sets with inject.

Link to this section Functions

-spec encode_span_id(non_neg_integer()) -> unicode:latin1_chardata().
Encode span_id to string.
Link to this function

encode_trace_id(Span_ctx)

View Source
-spec encode_trace_id(opentelemetry:span_ctx() | non_neg_integer()) -> unicode:latin1_chardata().
Encode trace_id to string.
Link to this function

extract(Context, Carrier, CarrierKeysFun, CarrierGetFun, Options)

View Source
-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.
Link to this function

inject(Context, Carrier, CarrierSetFun, Options)

View Source
-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.