Interface SpanExporter
- All Superinterfaces:
AutoCloseable,Closeable
An interface that allows different tracing services to export recorded data for sampled spans in
their own format.
To export data this MUST be register to the TracerSdk using a SimpleSpanProcessor or a BatchSampledSpansProcessor.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Closes thisSpanExporter, releasing any resources.static SpanExportercomposite(SpanExporter... exporters) Returns aSpanExporterwhich delegates all exports to theexportersin order.static SpanExportercomposite(Iterable<SpanExporter> exporters) Returns aSpanExporterwhich delegates all exports to theexportersin order.io.opentelemetry.sdk.common.CompletableResultCodeexport(Collection<SpanData> spans) Called to export sampledSpans.io.opentelemetry.sdk.common.CompletableResultCodeflush()Exports the collection of sampledSpans that have not yet been exported.io.opentelemetry.sdk.common.CompletableResultCodeshutdown()Called whenSdkTracerProvider.shutdown()is called, if thisSpanExporteris registered to aSdkTracerProviderobject.
-
Method Details
-
composite
Returns aSpanExporterwhich delegates all exports to theexportersin order.Can be used to export to multiple backends using the same
SpanProcessorlike aSimpleSpanProcessoror aBatchSpanProcessor. -
composite
Returns aSpanExporterwhich delegates all exports to theexportersin order.Can be used to export to multiple backends using the same
SpanProcessorlike aSimpleSpanProcessoror aBatchSpanProcessor. -
export
Called to export sampledSpans. Note that export operations can be performed simultaneously depending on the type of span processor being used. However, theBatchSpanProcessorwill ensure that only one export can occur at a time.- Parameters:
spans- the collection of sampled Spans to be exported.- Returns:
- the result of the export, which is often an asynchronous operation.
-
flush
io.opentelemetry.sdk.common.CompletableResultCode flush()Exports the collection of sampledSpans that have not yet been exported. Note that export operations can be performed simultaneously depending on the type of span processor being used. However, theBatchSpanProcessorwill ensure that only one export can occur at a time.- Returns:
- the result of the flush, which is often an asynchronous operation.
-
shutdown
io.opentelemetry.sdk.common.CompletableResultCode shutdown()Called whenSdkTracerProvider.shutdown()is called, if thisSpanExporteris registered to aSdkTracerProviderobject.- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes.
-
close
default void close()Closes thisSpanExporter, releasing any resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-