Class MultiSpanExporter
java.lang.Object
io.opentelemetry.sdk.trace.export.MultiSpanExporter
- All Implemented Interfaces:
SpanExporter
,Closeable
,AutoCloseable
SpanExporter
that forwards all received spans to a list of SpanExporter
.
Can be used to export to multiple backends using the same SpanProcessor
like a SimpleSpanProcessor
or a BatchSpanProcessor
.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static SpanExporter
create
(List<SpanExporter> spanExporters) Constructs and returns an instance of this class.export
(Collection<SpanData> spans) Called to export sampledSpan
s.flush()
Flushes the data of all registeredSpanExporter
s.shutdown()
Called whenSdkTracerProvider.shutdown()
is called, if thisSpanExporter
is registered to aSdkTracerProvider
object.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.opentelemetry.sdk.trace.export.SpanExporter
close
-
Field Details
-
logger
-
spanExporters
-
-
Constructor Details
-
MultiSpanExporter
-
-
Method Details
-
create
Constructs and returns an instance of this class.- Parameters:
spanExporters
- the exporters spans should be sent to- Returns:
- the aggregate span exporter
-
export
Description copied from interface:SpanExporter
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.- Specified by:
export
in interfaceSpanExporter
- Parameters:
spans
- the collection of sampled Spans to be exported.- Returns:
- the result of the export, which is often an asynchronous operation.
-
flush
Flushes the data of all registeredSpanExporter
s.- Specified by:
flush
in interfaceSpanExporter
- Returns:
- the result of the operation
-
shutdown
Description copied from interface:SpanExporter
Called whenSdkTracerProvider.shutdown()
is called, if thisSpanExporter
is registered to aSdkTracerProvider
object.- Specified by:
shutdown
in interfaceSpanExporter
- Returns:
- a
CompletableResultCode
which is completed when shutdown completes.
-
toString
-