Interface SpanExporter

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    MultiSpanExporter, NoopSpanExporter, OtlpGrpcSpanExporter, OtlpHttpSpanExporter

    public interface SpanExporter
    extends java.io.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 Detail

      • export

        CompletableResultCode export​(java.util.Collection<SpanData> spans)
        Called to export sampled Spans. Note that export operations can be performed simultaneously depending on the type of span processor being used. However, the BatchSpanProcessor 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

        CompletableResultCode flush()
        Exports the collection of sampled Spans that have not yet been exported. Note that export operations can be performed simultaneously depending on the type of span processor being used. However, the BatchSpanProcessor will ensure that only one export can occur at a time.
        Returns:
        the result of the flush, which is often an asynchronous operation.
      • close

        default void close()
        Closes this SpanExporter, releasing any resources.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable