public static final class DefaultContextPropagators.Builder extends Object
DefaultContextPropagators.Builder is used to construct a new ContextPropagators object with the specified
propagators.
This is a example of a ContextPropagators object being created:
ContextPropagators propagators = DefaultContextPropagators.builder()
.addTextMapPropagator(new HttpTraceContext())
.addTextMapPropagator(new HttpBaggage())
.addTextMapPropagator(new MyCustomContextPropagator())
.build();
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
DefaultContextPropagators.Builder |
addTextMapPropagator(TextMapPropagator textMapPropagator)
Adds a
TextMapPropagator propagator. |
ContextPropagators |
build()
Builds a new
ContextPropagators with the specified propagators. |
public DefaultContextPropagators.Builder addTextMapPropagator(TextMapPropagator textMapPropagator)
TextMapPropagator propagator.
One propagator per concern (traces, correlations, etc) should be added if this format is supported.
textMapPropagator - the propagator to be added.NullPointerException - if textMapPropagator is null.public ContextPropagators build()
ContextPropagators with the specified propagators.ContextPropagators instance.