Class OtlpHttpLogRecordExporter
java.lang.Object
io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporter
- All Implemented Interfaces:
LogRecordExporter
,Closeable
,AutoCloseable
@ThreadSafe
public final class OtlpHttpLogRecordExporter
extends Object
implements LogRecordExporter
Exports logs using OTLP via HTTP, using OpenTelemetry's protobuf model.
- Since:
- 1.27.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HttpExporterBuilder
<Marshaler> private final HttpExporter
<Marshaler> private final LogReusableDataMarshaler
-
Constructor Summary
ConstructorsConstructorDescriptionOtlpHttpLogRecordExporter
(HttpExporterBuilder<Marshaler> builder, HttpExporter<Marshaler> delegate, MemoryMode memoryMode) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Returns a new builder instance for this exporter.export
(Collection<LogRecordData> logs) Submits all the given logs in a single batch to the OpenTelemetry collector.flush()
Exports the collection ofLogRecordData
that have not yet been exported.static OtlpHttpLogRecordExporter
Returns a newOtlpHttpLogRecordExporter
using the default values.shutdown()
Shutdown the exporter.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
-
Field Details
-
builder
-
delegate
-
marshaler
-
-
Constructor Details
-
OtlpHttpLogRecordExporter
OtlpHttpLogRecordExporter(HttpExporterBuilder<Marshaler> builder, HttpExporter<Marshaler> delegate, MemoryMode memoryMode)
-
-
Method Details
-
getDefault
Returns a newOtlpHttpLogRecordExporter
using the default values.To load configuration values from environment variables and system properties, use opentelemetry-sdk-extension-autoconfigure.
- Returns:
- a new
OtlpHttpLogRecordExporter
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 logs in a single batch to the OpenTelemetry collector.- Specified by:
export
in interfaceLogRecordExporter
- Parameters:
logs
- the list of sampled Logs to be exported.- Returns:
- the result of the operation
-
flush
Description copied from interface:LogRecordExporter
Exports the collection ofLogRecordData
that have not yet been exported.- Specified by:
flush
in interfaceLogRecordExporter
- Returns:
- the result of the flush, which is often an asynchronous operation
-
shutdown
Shutdown the exporter.- Specified by:
shutdown
in interfaceLogRecordExporter
- Returns:
- a
CompletableResultCode
which is completed when shutdown completes
-
toString
-