Package io.opencensus.trace.export
Class SpanExporter
- java.lang.Object
-
- io.opencensus.trace.export.SpanExporter
-
- Direct Known Subclasses:
SpanExporter.NoopSpanExporter
,SpanExporterImpl
@ThreadSafe public abstract class SpanExporter extends java.lang.Object
A service that is used by the library to exportSpanData
for all the spans that are part of a distributed sampled trace (seeTraceOptions.isSampled()
).- Since:
- 0.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpanExporter.Handler
An abstract class that allows different tracing services to export recorded data for sampled spans in their own format.private static class
SpanExporter.NoopSpanExporter
-
Field Summary
Fields Modifier and Type Field Description private static SpanExporter
NOOP_SPAN_EXPORTER
-
Constructor Summary
Constructors Constructor Description SpanExporter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SpanExporter
getNoopSpanExporter()
Returns the no-op implementation of theExportComponent
.abstract void
registerHandler(java.lang.String name, SpanExporter.Handler handler)
Registers a new service handler that is used by the library to exportSpanData
for sampled spans (seeTraceOptions.isSampled()
).abstract void
unregisterHandler(java.lang.String name)
Unregisters the service handler with the provided name.
-
-
-
Field Detail
-
NOOP_SPAN_EXPORTER
private static final SpanExporter NOOP_SPAN_EXPORTER
-
-
Method Detail
-
getNoopSpanExporter
public static SpanExporter getNoopSpanExporter()
Returns the no-op implementation of theExportComponent
.- Returns:
- the no-op implementation of the
ExportComponent
. - Since:
- 0.5
-
registerHandler
public abstract void registerHandler(java.lang.String name, SpanExporter.Handler handler)
Registers a new service handler that is used by the library to exportSpanData
for sampled spans (seeTraceOptions.isSampled()
).- 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.- Since:
- 0.5
-
unregisterHandler
public abstract void unregisterHandler(java.lang.String name)
Unregisters the service handler with the provided name.- Parameters:
name
- the name of the service handler that will be unregistered.- Since:
- 0.5
-
-