Class AwsXrayPropagator

  • All Implemented Interfaces:
    io.opentelemetry.context.propagation.TextMapPropagator

    public final class AwsXrayPropagator
    extends Object
    implements io.opentelemetry.context.propagation.TextMapPropagator
    Implementation of the AWS X-Ray Trace Header propagation protocol. See AWS Tracing header spec

    To register the X-Ray propagator together with default propagator:

    
     OpenTelemetry.setPropagators(
       DefaultContextPropagators
         .builder()
         .addTextMapPropagator(W3CTraceContextPropagator.getInstance())
         .addTextMapPropagator(AWSXrayPropagator.getInstance())
         .build());
     
    • Method Detail

      • fields

        public Collection<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.TextMapPropagator.Setter<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.TextMapPropagator.Getter<C> getter)
        Specified by:
        extract in interface io.opentelemetry.context.propagation.TextMapPropagator