Class ExtendedContextPropagators

java.lang.Object
io.opentelemetry.api.incubator.propagation.ExtendedContextPropagators

public final class ExtendedContextPropagators extends Object
Utility class to simplify context propagation.

The README explains the use cases in more detail.

  • Field Details

  • Constructor Details

    • ExtendedContextPropagators

      private ExtendedContextPropagators()
  • Method Details

    • getTextMapPropagationContext

      public static Map<String,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 from OpenTelemetry.getPropagators()
    • extractTextMapPropagationContext

      public static Context extractTextMapPropagationContext(Map<String,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 map
      propagators - provide the propagators from OpenTelemetry.getPropagators()