Class OtlpGrpcSpanExporter
java.lang.Object
io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter
- All Implemented Interfaces:
SpanExporter,Closeable,AutoCloseable
Exports spans using OTLP via gRPC, using OpenTelemetry's protobuf model.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GrpcExporterBuilder<Marshaler> private final GrpcExporter<Marshaler> private final SpanReusableDataMarshaler -
Constructor Summary
ConstructorsConstructorDescriptionOtlpGrpcSpanExporter(GrpcExporterBuilder<Marshaler> builder, GrpcExporter<Marshaler> delegate, MemoryMode memoryMode) -
Method Summary
Modifier and TypeMethodDescriptionstatic OtlpGrpcSpanExporterBuilderbuilder()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 OtlpGrpcSpanExporterReturns a newOtlpGrpcSpanExporterusing the default values.shutdown()Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.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, waitMethods inherited from interface io.opentelemetry.sdk.trace.export.SpanExporter
close
-
Field Details
-
builder
-
delegate
-
marshaler
-
-
Constructor Details
-
OtlpGrpcSpanExporter
OtlpGrpcSpanExporter(GrpcExporterBuilder<Marshaler> builder, GrpcExporter<Marshaler> delegate, MemoryMode memoryMode)
-
-
Method Details
-
getDefault
Returns a newOtlpGrpcSpanExporterusing the default values.To load configuration values from environment variables and system properties, use opentelemetry-sdk-extension-autoconfigure.
- Returns:
- a new
OtlpGrpcSpanExporterinstance.
-
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:
exportin 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:
flushin interfaceSpanExporter- Returns:
- always Success
-
shutdown
Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.- Specified by:
shutdownin interfaceSpanExporter- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes.
-
toString
-