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 ofLogRecordDatathat have not yet been exported.static OtlpHttpLogRecordExporterReturns a newOtlpHttpLogRecordExporterusing the default values.shutdown()Shutdown the exporter.Returns a builder with configuration values equal to those for this exporter.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface LogRecordExporter
close
-
Field Details
-
builder
-
delegate
-
marshaler
-
-
Constructor Details
-
OtlpHttpLogRecordExporter
OtlpHttpLogRecordExporter(HttpExporterBuilder<Marshaler> builder, HttpExporter<Marshaler> delegate, MemoryMode memoryMode)
-
-
Method Details
-
getDefault
Returns a newOtlpHttpLogRecordExporterusing the default values.To load configuration values from environment variables and system properties, use opentelemetry-sdk-extension-autoconfigure.
- Returns:
- a new
OtlpHttpLogRecordExporterinstance.
-
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:
exportin interfaceLogRecordExporter- Parameters:
logs- the list of sampled Logs to be exported.- Returns:
- the result of the operation
-
flush
Description copied from interface:LogRecordExporterExports the collection ofLogRecordDatathat have not yet been exported.- Specified by:
flushin interfaceLogRecordExporter- Returns:
- the result of the flush, which is often an asynchronous operation
-
shutdown
Shutdown the exporter.- Specified by:
shutdownin interfaceLogRecordExporter- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes
-
toString
-