Class BaggageTextMapPropagator

java.lang.Object
io.micrometer.tracing.otel.propagation.BaggageTextMapPropagator
All Implemented Interfaces:
io.opentelemetry.context.propagation.TextMapPropagator

public class BaggageTextMapPropagator extends Object implements io.opentelemetry.context.propagation.TextMapPropagator
TextMapPropagator that adds compatible baggage entries (name of the field means an HTTP header entry). If existing baggage is present in the context, this will append entries to the existing one. Preferably this TextMapPropagator should be added as last.
Since:
1.0.0
  • Constructor Details

    • BaggageTextMapPropagator

      public BaggageTextMapPropagator(List<String> remoteFields, io.micrometer.tracing.BaggageManager baggageManager)
      Creates a new instance of BaggageTextMapPropagator.
      Parameters:
      remoteFields - remote fields
      baggageManager - baggage manager
  • Method Details

    • fields

      public List<String> fields()
      Specified by:
      fields in interface io.opentelemetry.context.propagation.TextMapPropagator
    • inject

      public <C> void inject(io.opentelemetry.context.Context context, C c, io.opentelemetry.context.propagation.TextMapSetter<C> setter)
      Specified by:
      inject in interface io.opentelemetry.context.propagation.TextMapPropagator
    • extract

      public <C> io.opentelemetry.context.Context extract(io.opentelemetry.context.Context context, C c, io.opentelemetry.context.propagation.TextMapGetter<C> getter)
      Specified by:
      extract in interface io.opentelemetry.context.propagation.TextMapPropagator