Class OtlpHttpSpanExporter

java.lang.Object
io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter
All Implemented Interfaces:
io.opentelemetry.sdk.trace.export.SpanExporter, Closeable, AutoCloseable

@ThreadSafe public final class OtlpHttpSpanExporter extends Object implements io.opentelemetry.sdk.trace.export.SpanExporter
Exports spans using OTLP via HTTP, using OpenTelemetry's protobuf model.
Since:
1.5.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new builder instance for this exporter.
    io.opentelemetry.sdk.common.CompletableResultCode
    export(Collection<io.opentelemetry.sdk.trace.data.SpanData> spans)
    Submits all the given spans in a single batch to the OpenTelemetry collector.
    io.opentelemetry.sdk.common.CompletableResultCode
    The OTLP exporter does not batch spans, so this method will immediately return with success.
    Returns a new OtlpHttpSpanExporter using the default values.
    io.opentelemetry.sdk.common.CompletableResultCode
    Shutdown the exporter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.opentelemetry.sdk.trace.export.SpanExporter

    close
  • Method Details

    • getDefault

      public static OtlpHttpSpanExporter getDefault()
      Returns a new OtlpHttpSpanExporter using the default values.
      Returns:
      a new OtlpHttpSpanExporter instance.
    • builder

      public static OtlpHttpSpanExporterBuilder builder()
      Returns a new builder instance for this exporter.
      Returns:
      a new builder instance for this exporter.
    • export

      public io.opentelemetry.sdk.common.CompletableResultCode export(Collection<io.opentelemetry.sdk.trace.data.SpanData> spans)
      Submits all the given spans in a single batch to the OpenTelemetry collector.
      Specified by:
      export in interface io.opentelemetry.sdk.trace.export.SpanExporter
      Parameters:
      spans - the list of sampled Spans to be exported.
      Returns:
      the result of the operation
    • flush

      public io.opentelemetry.sdk.common.CompletableResultCode flush()
      The OTLP exporter does not batch spans, so this method will immediately return with success.
      Specified by:
      flush in interface io.opentelemetry.sdk.trace.export.SpanExporter
      Returns:
      always Success
    • shutdown

      public io.opentelemetry.sdk.common.CompletableResultCode shutdown()
      Shutdown the exporter.
      Specified by:
      shutdown in interface io.opentelemetry.sdk.trace.export.SpanExporter