public final class MultiSpanProcessor extends Object implements SpanProcessor
SpanProcessor
that simply forwards all received events to a list of
SpanProcessor
s.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 SpanProcessor
s.MultiSpanProcessor
.NullPointerException
- if the spanProcessorList
is null
.public void onStart(ReadableSpan readableSpan)
SpanProcessor
Span
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 SpanProcessor
readableSpan
- the ReadableSpan
that just started.public boolean isStartRequired()
SpanProcessor
true
if this SpanProcessor
requires start events.isStartRequired
in interface SpanProcessor
true
if this SpanProcessor
requires start events.public void onEnd(ReadableSpan readableSpan)
SpanProcessor
Span
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 SpanProcessor
readableSpan
- the ReadableSpan
that just ended.public boolean isEndRequired()
SpanProcessor
true
if this SpanProcessor
requires end events.isEndRequired
in interface SpanProcessor
true
if this SpanProcessor
requires end events.public void shutdown()
SpanProcessor
TracerSdkProvider.shutdown()
is called.
Implementations must ensure that all span events are processed before returning.
shutdown
in interface SpanProcessor
public void forceFlush()
SpanProcessor
This method is executed synchronously on the calling thread, and should not throw exceptions.
forceFlush
in interface SpanProcessor