Class OtlpGrpcLogRecordExporter
java.lang.Object
io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporter
- All Implemented Interfaces:
io.opentelemetry.sdk.logs.export.LogRecordExporter
,Closeable
,AutoCloseable
@ThreadSafe
public final class OtlpGrpcLogRecordExporter
extends Object
implements io.opentelemetry.sdk.logs.export.LogRecordExporter
Exports logs using OTLP via gRPC, using OpenTelemetry's protobuf model.
- Since:
- 1.27.0
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Returns a new builder instance for this exporter.io.opentelemetry.sdk.common.CompletableResultCode
export
(Collection<io.opentelemetry.sdk.logs.data.LogRecordData> logs) Submits all the given logs in a single batch to the OpenTelemetry collector.io.opentelemetry.sdk.common.CompletableResultCode
flush()
static OtlpGrpcLogRecordExporter
Returns a newOtlpGrpcLogRecordExporter
using the default values.io.opentelemetry.sdk.common.CompletableResultCode
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, wait
Methods inherited from interface io.opentelemetry.sdk.logs.export.LogRecordExporter
close
-
Method Details
-
getDefault
Returns a newOtlpGrpcLogRecordExporter
using the default values.To load configuration values from environment variables and system properties, use opentelemetry-sdk-extension-autoconfigure.
- Returns:
- a new
OtlpGrpcLogRecordExporter
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
public io.opentelemetry.sdk.common.CompletableResultCode export(Collection<io.opentelemetry.sdk.logs.data.LogRecordData> logs) Submits all the given logs in a single batch to the OpenTelemetry collector.- Specified by:
export
in interfaceio.opentelemetry.sdk.logs.export.LogRecordExporter
- Parameters:
logs
- the list of sampled logs to be exported.- Returns:
- the result of the operation
-
flush
public io.opentelemetry.sdk.common.CompletableResultCode flush()- Specified by:
flush
in interfaceio.opentelemetry.sdk.logs.export.LogRecordExporter
-
shutdown
public io.opentelemetry.sdk.common.CompletableResultCode shutdown()Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.- Specified by:
shutdown
in interfaceio.opentelemetry.sdk.logs.export.LogRecordExporter
-
toString
-