Class OtlpHttpLogRecordExporter
- java.lang.Object
-
- io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporter
-
- All Implemented Interfaces:
LogRecordExporter,java.io.Closeable,java.lang.AutoCloseable
@ThreadSafe public final class OtlpHttpLogRecordExporter extends java.lang.Object implements LogRecordExporter
Exports logs using OTLP via HTTP, using OpenTelemetry's protobuf model.- Since:
- 1.27.0
-
-
Field Summary
Fields Modifier and Type Field Description private HttpExporterBuilder<Marshaler>builderprivate HttpExporter<Marshaler>delegateprivate LogReusableDataMarshalermarshaler
-
Constructor Summary
Constructors Constructor Description OtlpHttpLogRecordExporter(HttpExporterBuilder<Marshaler> builder, HttpExporter<Marshaler> delegate, MemoryMode memoryMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OtlpHttpLogRecordExporterBuilderbuilder()Returns a new builder instance for this exporter.CompletableResultCodeexport(java.util.Collection<LogRecordData> logs)Submits all the given logs in a single batch to the OpenTelemetry collector.CompletableResultCodeflush()Exports the collection ofLogRecordDatathat have not yet been exported.static OtlpHttpLogRecordExportergetDefault()Returns a newOtlpHttpLogRecordExporterusing the default values.CompletableResultCodeshutdown()Shutdown the exporter.OtlpHttpLogRecordExporterBuildertoBuilder()Returns a builder with configuration values equal to those for this exporter.java.lang.StringtoString()-
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 Detail
-
builder
private final HttpExporterBuilder<Marshaler> builder
-
delegate
private final HttpExporter<Marshaler> delegate
-
marshaler
private final LogReusableDataMarshaler marshaler
-
-
Constructor Detail
-
OtlpHttpLogRecordExporter
OtlpHttpLogRecordExporter(HttpExporterBuilder<Marshaler> builder, HttpExporter<Marshaler> delegate, MemoryMode memoryMode)
-
-
Method Detail
-
getDefault
public static OtlpHttpLogRecordExporter 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
public static OtlpHttpLogRecordExporterBuilder builder()
Returns a new builder instance for this exporter.- Returns:
- a new builder instance for this exporter.
-
toBuilder
public OtlpHttpLogRecordExporterBuilder 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 CompletableResultCode export(java.util.Collection<LogRecordData> logs)
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
public CompletableResultCode 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
public CompletableResultCode shutdown()
Shutdown the exporter.- Specified by:
shutdownin interfaceLogRecordExporter- Returns:
- a
CompletableResultCodewhich is completed when shutdown completes
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-