public final class MultiSpanProcessor extends Object implements SpanProcessor
SpanProcessor that simply forwards all received events to a list of
SpanProcessors.| Modifier and Type | Method and Description |
|---|---|
static SpanProcessor |
create(List<SpanProcessor> spanProcessorList)
Creates a new
MultiSpanProcessor. |
void |
forceFlush()
Processes all span events that have not yet been processed.
|
boolean |
isEndRequired()
Returns
true if this SpanProcessor requires end events. |
boolean |
isStartRequired()
Returns
true if this SpanProcessor requires start events. |
void |
onEnd(ReadableSpan readableSpan)
Called when a
Span is ended, if the Span.isRecording()
returns true. |
void |
onStart(ReadableSpan readableSpan)
Called when a
Span is started, if the Span.isRecording()
returns true. |
void |
shutdown()
Called when
TracerSdkProvider.shutdown() is called. |
public static SpanProcessor create(List<SpanProcessor> spanProcessorList)
MultiSpanProcessor.spanProcessorList - the List of SpanProcessors.MultiSpanProcessor.NullPointerException - if the spanProcessorList is null.public void onStart(ReadableSpan readableSpan)
SpanProcessorSpan is started, if the Span.isRecording()
returns true.
This method is called synchronously on the execution thread, should not throw or block the execution thread.
onStart in interface SpanProcessorreadableSpan - the ReadableSpan that just started.public boolean isStartRequired()
SpanProcessortrue if this SpanProcessor requires start events.isStartRequired in interface SpanProcessortrue if this SpanProcessor requires start events.public void onEnd(ReadableSpan readableSpan)
SpanProcessorSpan is ended, if the Span.isRecording()
returns true.
This method is called synchronously on the execution thread, should not throw or block the execution thread.
onEnd in interface SpanProcessorreadableSpan - the ReadableSpan that just ended.public boolean isEndRequired()
SpanProcessortrue if this SpanProcessor requires end events.isEndRequired in interface SpanProcessortrue if this SpanProcessor requires end events.public void shutdown()
SpanProcessorTracerSdkProvider.shutdown() is called.
Implementations must ensure that all span events are processed before returning.
shutdown in interface SpanProcessorpublic void forceFlush()
SpanProcessorThis method is called synchronously on the execution thread, and should not throw exceptions.
forceFlush in interface SpanProcessor