public final class SimpleSpansProcessor extends Object implements SpanProcessor
SpanProcessor that converts the ReadableSpan to SpanData and passes it to the configured exporter.| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleSpansProcessor.Builder
Builder class for
SimpleSpansProcessor. |
| Modifier and Type | Method and Description |
|---|---|
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. |
static SimpleSpansProcessor.Builder |
newBuilder(SpanExporter spanExporter)
Returns a new Builder for
SimpleSpansProcessor. |
void |
onEnd(ReadableSpan span)
Called when a
Span is ended, if the Span.isRecording()
returns true. |
void |
onStart(ReadableSpan span)
Called when a
Span is started, if the Span.isRecording()
returns true. |
void |
shutdown()
Called when
TracerSdkProvider.shutdown() is called. |
public void onStart(ReadableSpan span)
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 SpanProcessorspan - 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 span)
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 SpanProcessorspan - 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 SpanProcessorpublic static SimpleSpansProcessor.Builder newBuilder(SpanExporter spanExporter)
SimpleSpansProcessor.spanExporter - the SpanExporter to where the Spans are pushed.SimpleSpansProcessor.NullPointerException - if the spanExporter is null.