Class OtlpGrpcLogExporter
java.lang.Object
io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogExporter
- All Implemented Interfaces:
io.opentelemetry.sdk.logs.export.LogExporter,Closeable,AutoCloseable
@ThreadSafe
public final class OtlpGrpcLogExporter
extends Object
implements io.opentelemetry.sdk.logs.export.LogExporter
Exports logs using OTLP via gRPC, using OpenTelemetry's protobuf model.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OtlpGrpcLogExporterBuilderbuilder()Returns a new builder instance for this exporter.io.opentelemetry.sdk.common.CompletableResultCodeexport(Collection<io.opentelemetry.sdk.logs.data.LogData> logs) Submits all the given logs in a single batch to the OpenTelemetry collector.io.opentelemetry.sdk.common.CompletableResultCodeflush()static OtlpGrpcLogExporterReturns a newOtlpGrpcLogExporterreading the configuration values from the environment and from system properties.io.opentelemetry.sdk.common.CompletableResultCodeshutdown()Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.opentelemetry.sdk.logs.export.LogExporter
close
-
Method Details
-
getDefault
Returns a newOtlpGrpcLogExporterreading the configuration values from the environment and from system properties. System properties override values defined in the environment. If a configuration value is missing, it uses the default value.- Returns:
- a new
OtlpGrpcLogExporterinstance.
-
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.logs.data.LogData> logs) Submits all the given logs in a single batch to the OpenTelemetry collector.- Specified by:
exportin interfaceio.opentelemetry.sdk.logs.export.LogExporter- 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:
flushin interfaceio.opentelemetry.sdk.logs.export.LogExporter
-
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:
shutdownin interfaceio.opentelemetry.sdk.logs.export.LogExporter
-