Class W3CTraceContextPropagator

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

    @Immutable
    public final class W3CTraceContextPropagator
    extends java.lang.Object
    implements io.opentelemetry.context.propagation.TextMapPropagator
    Implementation of the W3C TraceContext propagation protocol. See W3C Trace Context.

    This is the default propagator for SpanContexts. The SpanContext type is designed to support all the data propagated via W3C propagation natively.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <C> io.opentelemetry.context.Context extract​(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapGetter<C> getter)  
      java.util.Collection<java.lang.String> fields()  
      static W3CTraceContextPropagator getInstance()
      Returns a singleton instance of a TextMapPropagator implementing the W3C TraceContext propagation.
      <C> void inject​(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapSetter<C> setter)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static W3CTraceContextPropagator getInstance()
        Returns a singleton instance of a TextMapPropagator implementing the W3C TraceContext propagation.
      • fields

        public java.util.Collection<java.lang.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