Class W3CTraceContextPropagator
- java.lang.Object
-
- io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator
-
- All Implemented Interfaces:
io.opentelemetry.context.propagation.TextMapPropagator
@Immutable public final class W3CTraceContextPropagator extends 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. TheSpanContexttype 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.Contextextract(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapPropagator.Getter<C> getter)Collection<String>fields()static W3CTraceContextPropagatorgetInstance()Returns a singleton instance of aTextMapPropagatorimplementing the W3C TraceContext propagation.<C> voidinject(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapPropagator.Setter<C> setter)
-
-
-
Method Detail
-
getInstance
public static W3CTraceContextPropagator getInstance()
Returns a singleton instance of aTextMapPropagatorimplementing the W3C TraceContext propagation.
-
fields
public Collection<String> fields()
- Specified by:
fieldsin interfaceio.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:
injectin interfaceio.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:
extractin interfaceio.opentelemetry.context.propagation.TextMapPropagator
-
-