Class BaggageSpanProcessor

java.lang.Object
io.opentelemetry.contrib.baggage.processor.BaggageSpanProcessor
All Implemented Interfaces:
io.opentelemetry.sdk.trace.SpanProcessor, Closeable, AutoCloseable

public class BaggageSpanProcessor extends Object implements io.opentelemetry.sdk.trace.SpanProcessor
This span processor copies attributes stored in Baggage into each newly created Span.
  • Constructor Details

    • BaggageSpanProcessor

      public BaggageSpanProcessor(Predicate<String> baggageKeyPredicate)
      Creates a new BaggageSpanProcessor that copies only baggage entries with keys that pass the provided filter into the newly created Span.
  • Method Details

    • allowAllBaggageKeys

      public static BaggageSpanProcessor allowAllBaggageKeys()
      Creates a new BaggageSpanProcessor that copies all baggage entries into the newly created Span.
    • onStart

      public void onStart(io.opentelemetry.context.Context parentContext, io.opentelemetry.sdk.trace.ReadWriteSpan span)
      Specified by:
      onStart in interface io.opentelemetry.sdk.trace.SpanProcessor
    • isStartRequired

      public boolean isStartRequired()
      Specified by:
      isStartRequired in interface io.opentelemetry.sdk.trace.SpanProcessor
    • onEnd

      public void onEnd(io.opentelemetry.sdk.trace.ReadableSpan span)
      Specified by:
      onEnd in interface io.opentelemetry.sdk.trace.SpanProcessor
    • isEndRequired

      public boolean isEndRequired()
      Specified by:
      isEndRequired in interface io.opentelemetry.sdk.trace.SpanProcessor