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 SpanExportercreate(List<SpanExporter> spanExporters) Constructs and returns an instance of this class.export(Collection<SpanData> spans) Called to export sampledSpans.flush()Flushes the data of all registeredSpanExporters.shutdown()Called whenSdkTracerProvider.shutdown()is called, if thisSpanExporteris registered to aSdkTracerProviderobject.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:SpanExporterCalled 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.- Specified by:
exportin 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 registeredSpanExporters.- Specified by:
flushin interfaceSpanExporter- Returns:
- the result of the operation
-
shutdown
Description copied from interface:SpanExporterCalled whenSdkTracerProvider.shutdown()is called, if thisSpanExporteris registered to aSdkTracerProviderobject.- Specified by:
shutdownin interfaceSpanExporter- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes.
-
toString
-