Class PassThroughPropagator
java.lang.Object
io.opentelemetry.api.incubator.propagation.PassThroughPropagator
- All Implemented Interfaces:
io.opentelemetry.context.propagation.TextMapPropagator
public final class PassThroughPropagator
extends Object
implements io.opentelemetry.context.propagation.TextMapPropagator
A
TextMapPropagator which can be configured with a set of fields, which will be extracted
and stored in Context. If the Context is used again to inject, the values will be
injected as-is. This TextMapPropagator is appropriate for a service that does not need to
participate in telemetry in any way and provides the most efficient way of propagating incoming
context to outgoing requests. In almost all cases, you will configure this single TextMapPropagator when using OpenTelemetry.propagating(ContextPropagators) to create an OpenTelemetry that only propagates. Similarly, you will never need this
when using the OpenTelemetry SDK to enable telemetry.-
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.context.propagation.TextMapPropagatorReturns aTextMapPropagatorwhich will propagate the givenfieldsfrom extraction to injection.static io.opentelemetry.context.propagation.TextMapPropagatorReturns aTextMapPropagatorwhich will propagate the givenfieldsfrom extraction to injection.<C> io.opentelemetry.context.Contextextract(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapGetter<C> getter) fields()<C> voidinject(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapSetter<C> setter) toString()
-
Method Details
-
create
Returns aTextMapPropagatorwhich will propagate the givenfieldsfrom extraction to injection. -
create
public static io.opentelemetry.context.propagation.TextMapPropagator create(Iterable<String> fields) Returns aTextMapPropagatorwhich will propagate the givenfieldsfrom extraction to injection. -
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.TextMapSetter<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.TextMapGetter<C> getter) - Specified by:
extractin interfaceio.opentelemetry.context.propagation.TextMapPropagator
-
toString
-