Interface SpanExporter
-
- All Superinterfaces:
AutoCloseable
,Closeable
public interface SpanExporter extends 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 aSimpleSpanProcessor
or aBatchSampledSpansProcessor
.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Closes thisSpanExporter
, releasing any resources.static SpanExporter
composite(SpanExporter... exporters)
Returns aSpanExporter
which simply delegates all exports to theexporters
in order.static SpanExporter
composite(Iterable<SpanExporter> exporters)
Returns aSpanExporter
which simply delegates all exports to theexporters
in order.io.opentelemetry.sdk.common.CompletableResultCode
export(Collection<SpanData> spans)
Called to export sampledSpan
s.io.opentelemetry.sdk.common.CompletableResultCode
flush()
Exports the collection of sampledSpan
s that have not yet been exported.io.opentelemetry.sdk.common.CompletableResultCode
shutdown()
Called whenSdkTracerProvider.shutdown()
is called, if thisSpanExporter
is registered to aSdkTracerProvider
object.
-
-
-
Method Detail
-
composite
static SpanExporter composite(SpanExporter... exporters)
Returns aSpanExporter
which simply delegates all exports to theexporters
in order.Can be used to export to multiple backends using the same
SpanProcessor
like aSimpleSampledSpansProcessor
or aBatchSampledSpansProcessor
.
-
composite
static SpanExporter composite(Iterable<SpanExporter> exporters)
Returns aSpanExporter
which simply delegates all exports to theexporters
in order.Can be used to export to multiple backends using the same
SpanProcessor
like aSimpleSampledSpansProcessor
or aBatchSampledSpansProcessor
.
-
export
io.opentelemetry.sdk.common.CompletableResultCode export(Collection<SpanData> spans)
Called to export sampledSpan
s. Note that export operations can be performed simultaneously depending on the type of span processor being used. However, theBatchSpanProcessor
will 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 sampledSpan
s that have not yet been exported. Note that export operations can be performed simultaneously depending on the type of span processor being used. However, theBatchSpanProcessor
will 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 thisSpanExporter
is registered to aSdkTracerProvider
object.- Returns:
- a
CompletableResultCode
which is completed when shutdown completes.
-
close
default void close()
Closes thisSpanExporter
, releasing any resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-