Class ExtendedContextPropagators
- java.lang.Object
-
- io.opentelemetry.api.incubator.propagation.ExtendedContextPropagators
-
public final class ExtendedContextPropagators extends java.lang.Object
Utility class to simplify context propagation.The README explains the use cases in more detail.
-
-
Field Summary
Fields Modifier and Type Field Description private static TextMapGetter<java.util.Map<java.lang.String,java.lang.String>>
TEXT_MAP_GETTER
-
Constructor Summary
Constructors Modifier Constructor Description private
ExtendedContextPropagators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Context
extractTextMapPropagationContext(java.util.Map<java.lang.String,java.lang.String> carrier, ContextPropagators propagators)
Extract the context from a string map, which you get from HTTP headers of the metadata of a message you're processing.static java.util.Map<java.lang.String,java.lang.String>
getTextMapPropagationContext(ContextPropagators propagators)
Injects the current context into a string map, which can then be added to HTTP headers or the metadata of a message.
-
-
-
Field Detail
-
TEXT_MAP_GETTER
private static final TextMapGetter<java.util.Map<java.lang.String,java.lang.String>> TEXT_MAP_GETTER
-
-
Method Detail
-
getTextMapPropagationContext
public static java.util.Map<java.lang.String,java.lang.String> getTextMapPropagationContext(ContextPropagators propagators)
Injects the current context into a string map, which can then be added to HTTP headers or the metadata of a message.- Parameters:
propagators
- provide the propagators fromOpenTelemetry.getPropagators()
-
extractTextMapPropagationContext
public static Context extractTextMapPropagationContext(java.util.Map<java.lang.String,java.lang.String> carrier, ContextPropagators propagators)
Extract the context from a string map, which you get from HTTP headers of the metadata of a message you're processing.- Parameters:
carrier
- the string mappropagators
- provide the propagators fromOpenTelemetry.getPropagators()
-
-