ContextPropagators[Ctx] is a container that holds registered propagators for every supported format. It provides a centralized way to manage text map propagators used for extracting and injecting context across process boundaries.
Overview
Context propagators are essential for distributing trace context and baggage across service boundaries. TheContextPropagators trait acts as a registry that holds the configured propagators for your application.
Type Parameters
Ctx- The type of the context used for propagation
Methods
textMapPropagator
Factory Methods
of
ContextPropagators instance which can be used to extract and inject context in text payloads with the given TextMapPropagator.
If multiple text map propagators are passed, a combined (composite) TextMapPropagator instance will be created.
Example:
noop
ContextPropagators. The contained TextMapPropagator also has a no-op implementation, meaning all propagation operations will do nothing.
Useful for testing or when propagation is not required.
Usage
Typically, you’ll create aContextPropagators instance during application initialization and use it throughout your application: