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. |
io.opentelemetry.sdk.common.CompletableResultCode |
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(ReadWriteSpan readableSpan)
Called when a
Span is started, if the Span.isRecording()
returns true. |
io.opentelemetry.sdk.common.CompletableResultCode |
shutdown()
Processes all span events that have not yet been processed and closes used resources.
|
public static SpanProcessor create(List<SpanProcessor> spanProcessorList)
MultiSpanProcessor.spanProcessorList - the List of SpanProcessors.MultiSpanProcessor.NullPointerException - if the spanProcessorList is null.public void onStart(ReadWriteSpan 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 io.opentelemetry.sdk.common.CompletableResultCode shutdown()
SpanProcessorshutdown in interface SpanProcessorCompletableResultCode which completes when shutdown is finished.public io.opentelemetry.sdk.common.CompletableResultCode forceFlush()
SpanProcessorforceFlush in interface SpanProcessorCompletableResultCode which completes when currently queued spans are
finished processing.