Class OtlpHttpSpanExporter
java.lang.Object
io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter
- All Implemented Interfaces:
SpanExporter
,Closeable
,AutoCloseable
Exports spans using OTLP via HTTP, using OpenTelemetry's protobuf model.
- Since:
- 1.5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HttpExporterBuilder
<Marshaler> private final HttpExporter
<Marshaler> private final SpanReusableDataMarshaler
-
Constructor Summary
ConstructorsConstructorDescriptionOtlpHttpSpanExporter
(HttpExporterBuilder<Marshaler> builder, HttpExporter<Marshaler> delegate, MemoryMode memoryMode) -
Method Summary
Modifier and TypeMethodDescriptionstatic OtlpHttpSpanExporterBuilder
builder()
Returns a new builder instance for this exporter.export
(Collection<SpanData> spans) Submits all the given spans in a single batch to the OpenTelemetry collector.flush()
The OTLP exporter does not batch spans, so this method will immediately return with success.static OtlpHttpSpanExporter
Returns a newOtlpHttpSpanExporter
using the default values.shutdown()
Shutdown the exporter, releasing any resources and preventing subsequent exports.Returns a builder with configuration values equal to those for this exporter.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
-
builder
-
delegate
-
marshaler
-
-
Constructor Details
-
OtlpHttpSpanExporter
OtlpHttpSpanExporter(HttpExporterBuilder<Marshaler> builder, HttpExporter<Marshaler> delegate, MemoryMode memoryMode)
-
-
Method Details
-
getDefault
Returns a newOtlpHttpSpanExporter
using the default values.To load configuration values from environment variables and system properties, use opentelemetry-sdk-extension-autoconfigure.
- Returns:
- a new
OtlpHttpSpanExporter
instance.
-
builder
Returns a new builder instance for this exporter.- Returns:
- a new builder instance for this exporter.
-
toBuilder
Returns a builder with configuration values equal to those for this exporter.IMPORTANT: Be sure to
shutdown()
this instance if it will no longer be used.- Since:
- 1.29.0
-
export
Submits all the given spans in a single batch to the OpenTelemetry collector.- Specified by:
export
in interfaceSpanExporter
- Parameters:
spans
- the list of sampled Spans to be exported.- Returns:
- the result of the operation
-
flush
The OTLP exporter does not batch spans, so this method will immediately return with success.- Specified by:
flush
in interfaceSpanExporter
- Returns:
- always Success
-
shutdown
Shutdown the exporter, releasing any resources and preventing subsequent exports.- Specified by:
shutdown
in interfaceSpanExporter
- Returns:
- a
CompletableResultCode
which is completed when shutdown completes.
-
toString
-