Class AwsXrayLambdaPropagator

java.lang.Object
io.opentelemetry.contrib.awsxray.propagator.AwsXrayLambdaPropagator
All Implemented Interfaces:
io.opentelemetry.context.propagation.TextMapPropagator

public final class AwsXrayLambdaPropagator extends Object implements io.opentelemetry.context.propagation.TextMapPropagator
Implementation of the AWS X-Ray Trace Header propagation protocol but with special handling for Lambda's _X_AMZN_TRACE_ID environment variable and com.amazonaws.xray.traceHeader system property.

To register the X-Ray propagator together with default propagator when using the SDK:


 OpenTelemetrySdk.builder()
   .setPropagators(
     ContextPropagators.create(
         TextMapPropagator.composite(
             W3CTraceContextPropagator.getInstance(),
             AwsXrayLambdaPropagator.getInstance())))
    .build();
 
  • Method Details

    • getInstance

      public static AwsXrayLambdaPropagator getInstance()
    • fields

      public List<String> fields()
      Specified by:
      fields in interface io.opentelemetry.context.propagation.TextMapPropagator
    • inject

      public <C> void inject(io.opentelemetry.context.Context context, @Nullable C carrier, io.opentelemetry.context.propagation.TextMapSetter<C> setter)
      Specified by:
      inject in interface io.opentelemetry.context.propagation.TextMapPropagator
    • extract

      public <C> io.opentelemetry.context.Context extract(io.opentelemetry.context.Context context, @Nullable C carrier, io.opentelemetry.context.propagation.TextMapGetter<C> getter)
      Specified by:
      extract in interface io.opentelemetry.context.propagation.TextMapPropagator