Package io.opentelemetry.sdk.logs.export
Class BatchLogRecordProcessorBuilder
java.lang.Object
io.opentelemetry.sdk.logs.export.BatchLogRecordProcessorBuilder
Builder class for
BatchLogRecordProcessor.- Since:
- 1.27.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newBatchLogRecordProcessorthat batches, then forwards them to the givenlogRecordExporter.setExporterTimeout(long timeout, TimeUnit unit) Sets the maximum time an export will be allowed to run before being cancelled.setExporterTimeout(Duration timeout) Sets the maximum time an export will be allowed to run before being cancelled.setMaxExportBatchSize(int maxExportBatchSize) Sets the maximum batch size for every export.setMaxQueueSize(int maxQueueSize) Sets the maximum number of Logs that are kept in the queue before start dropping.setMeterProvider(io.opentelemetry.api.metrics.MeterProvider meterProvider) Sets theMeterProviderto use to collect metrics related to batch export.setScheduleDelay(long delay, TimeUnit unit) Sets the delay interval between two consecutive exports.setScheduleDelay(Duration delay) Sets the delay interval between two consecutive exports.
-
Method Details
-
setScheduleDelay
Sets the delay interval between two consecutive exports. If unset, defaults to 1000Lms. -
setScheduleDelay
Sets the delay interval between two consecutive exports. If unset, defaults to 1000Lms. -
setExporterTimeout
Sets the maximum time an export will be allowed to run before being cancelled. If unset, defaults to 30000ms. -
setExporterTimeout
Sets the maximum time an export will be allowed to run before being cancelled. If unset, defaults to 30000ms. -
setMaxQueueSize
Sets the maximum number of Logs that are kept in the queue before start dropping. More memory than this value may be allocated to optimize queue access.Default value is
2048.- Parameters:
maxQueueSize- the maximum number of Logs that are kept in the queue before start dropping.- Returns:
- this.
- Throws:
IllegalArgumentException- ifmaxQueueSizeis not positive.- See Also:
-
DEFAULT_MAX_QUEUE_SIZE
-
setMaxExportBatchSize
Sets the maximum batch size for every export. This must be smaller or equal tomaxQueueSize.Default value is
512.- Parameters:
maxExportBatchSize- the maximum batch size for every export.- Returns:
- this.
- See Also:
-
DEFAULT_MAX_EXPORT_BATCH_SIZE
-
setMeterProvider
public BatchLogRecordProcessorBuilder setMeterProvider(io.opentelemetry.api.metrics.MeterProvider meterProvider) Sets theMeterProviderto use to collect metrics related to batch export. If not set, metrics will not be collected. -
build
Returns a newBatchLogRecordProcessorthat batches, then forwards them to the givenlogRecordExporter.- Returns:
- a new
BatchLogRecordProcessor.
-