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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaggageSpanProcessor(Predicate<String> baggageKeyPredicate) Creates a newBaggageSpanProcessorthat copies only baggage entries with keys that pass the provided filter into the newly createdSpan. -
Method Summary
Modifier and TypeMethodDescriptionstatic BaggageSpanProcessorCreates a newBaggageSpanProcessorthat copies all baggage entries into the newly createdSpan.booleanbooleanvoidonEnd(io.opentelemetry.sdk.trace.ReadableSpan span) voidonStart(io.opentelemetry.context.Context parentContext, io.opentelemetry.sdk.trace.ReadWriteSpan span) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.opentelemetry.sdk.trace.SpanProcessor
close, forceFlush, shutdown
-
Field Details
-
allowAllBaggageKeys
Deprecated.useallowAllBaggageKeys()instead
-
-
Constructor Details
-
BaggageSpanProcessor
Creates a newBaggageSpanProcessorthat copies only baggage entries with keys that pass the provided filter into the newly createdSpan.
-
-
Method Details
-
allowAllBaggageKeys
Creates a newBaggageSpanProcessorthat copies all baggage entries into the newly createdSpan. -
onStart
public void onStart(io.opentelemetry.context.Context parentContext, io.opentelemetry.sdk.trace.ReadWriteSpan span) - Specified by:
onStartin interfaceio.opentelemetry.sdk.trace.SpanProcessor
-
isStartRequired
public boolean isStartRequired()- Specified by:
isStartRequiredin interfaceio.opentelemetry.sdk.trace.SpanProcessor
-
onEnd
public void onEnd(io.opentelemetry.sdk.trace.ReadableSpan span) - Specified by:
onEndin interfaceio.opentelemetry.sdk.trace.SpanProcessor
-
isEndRequired
public boolean isEndRequired()- Specified by:
isEndRequiredin interfaceio.opentelemetry.sdk.trace.SpanProcessor
-