Class SpanExporterImpl
java.lang.Object
io.opencensus.trace.export.SpanExporter
io.opencensus.implcore.trace.export.SpanExporterImpl
Implementation of the
SpanExporter
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
private static final class
Nested classes/interfaces inherited from class io.opencensus.trace.export.SpanExporter
SpanExporter.Handler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DerivedLongCumulative
private static final Logger
private static final DerivedLongCumulative
private static final DerivedLongGauge
private final SpanExporterImpl.Worker
private final Thread
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSpan
(RecordEventsSpanImpl span) Adds a Span to the exporting service.(package private) static SpanExporterImpl
Constructs aSpanExporterImpl
that exports theSpanData
asynchronously.(package private) void
flush()
(package private) long
(package private) long
(package private) long
(package private) Thread
void
registerHandler
(String name, SpanExporter.Handler handler) Registers a new service handler that is used by the library to exportSpanData
for sampled spans (seeTraceOptions.isSampled()
).(package private) void
shutdown()
void
unregisterHandler
(String name) Unregisters the service handler with the provided name.Methods inherited from class io.opencensus.trace.export.SpanExporter
getNoopSpanExporter
-
Field Details
-
logger
-
droppedSpans
-
pushedSpans
-
referencedSpans
-
worker
-
workerThread
-
-
Constructor Details
-
SpanExporterImpl
-
-
Method Details
-
create
Constructs aSpanExporterImpl
that exports theSpanData
asynchronously.Starts a separate thread that wakes up every
scheduleDelay
and exports any available spans data. If the number of buffered SpanData objects is greater thanbufferSize
then the thread wakes up sooner.- Parameters:
bufferSize
- the size of the buffered span data.scheduleDelay
- the maximum delay.
-
addSpan
Adds a Span to the exporting service.- Parameters:
span
- theSpan
to be added.
-
registerHandler
Description copied from class:SpanExporter
Registers a new service handler that is used by the library to exportSpanData
for sampled spans (seeTraceOptions.isSampled()
).- Specified by:
registerHandler
in classSpanExporter
- Parameters:
name
- the name of the service handler. Must be unique for each service.handler
- the service handler that is called for each ended sampled span.
-
unregisterHandler
Description copied from class:SpanExporter
Unregisters the service handler with the provided name.- Specified by:
unregisterHandler
in classSpanExporter
- Parameters:
name
- the name of the service handler that will be unregistered.
-
flush
void flush() -
shutdown
void shutdown() -
getServiceExporterThread
Thread getServiceExporterThread() -
getDroppedSpans
long getDroppedSpans() -
getReferencedSpans
long getReferencedSpans() -
getPushedSpans
long getPushedSpans()
-