Class BatchSpanProcessorBuilder
java.lang.Object
io.opentelemetry.sdk.trace.export.BatchSpanProcessorBuilder
Builder class for
BatchSpanProcessor
.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final long
private long
private boolean
private int
private int
private MeterProvider
private long
private final SpanExporter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newBatchSpanProcessor
that batches, then converts spans to proto and forwards them to the givenspanExporter
.(package private) long
(package private) int
(package private) int
(package private) long
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.setExportUnsampledSpans
(boolean exportUnsampledSpans) Sets whether unsampled spans should be exported.setMaxExportBatchSize
(int maxExportBatchSize) Sets the maximum batch size for every export.setMaxQueueSize
(int maxQueueSize) Sets the maximum number of Spans that are kept in the queue before start dropping.setMeterProvider
(MeterProvider meterProvider) Sets theMeterProvider
to 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.
-
Field Details
-
DEFAULT_SCHEDULE_DELAY_MILLIS
static final long DEFAULT_SCHEDULE_DELAY_MILLIS- See Also:
-
DEFAULT_MAX_QUEUE_SIZE
static final int DEFAULT_MAX_QUEUE_SIZE- See Also:
-
DEFAULT_MAX_EXPORT_BATCH_SIZE
static final int DEFAULT_MAX_EXPORT_BATCH_SIZE- See Also:
-
DEFAULT_EXPORT_TIMEOUT_MILLIS
static final int DEFAULT_EXPORT_TIMEOUT_MILLIS- See Also:
-
spanExporter
-
exportUnsampledSpans
private boolean exportUnsampledSpans -
scheduleDelayNanos
private long scheduleDelayNanos -
maxQueueSize
private int maxQueueSize -
maxExportBatchSize
private int maxExportBatchSize -
exporterTimeoutNanos
private long exporterTimeoutNanos -
meterProvider
-
-
Constructor Details
-
BatchSpanProcessorBuilder
BatchSpanProcessorBuilder(SpanExporter spanExporter)
-
-
Method Details
-
setExportUnsampledSpans
Sets whether unsampled spans should be exported. If unset, defaults to exporting only sampled spans.- Since:
- 1.34.0
-
setScheduleDelay
Sets the delay interval between two consecutive exports. If unset, defaults to 5000Lms. -
setScheduleDelay
Sets the delay interval between two consecutive exports. If unset, defaults to 5000Lms. -
getScheduleDelayNanos
long getScheduleDelayNanos() -
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. -
getExporterTimeoutNanos
long getExporterTimeoutNanos() -
setMaxQueueSize
Sets the maximum number of Spans 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 Spans that are kept in the queue before start dropping.- Returns:
- this.
- See Also:
-
getMaxQueueSize
int getMaxQueueSize() -
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:
-
setMeterProvider
Sets theMeterProvider
to use to collect metrics related to batch export. If not set, metrics will not be collected. -
getMaxExportBatchSize
int getMaxExportBatchSize() -
build
Returns a newBatchSpanProcessor
that batches, then converts spans to proto and forwards them to the givenspanExporter
.- Returns:
- a new
BatchSpanProcessor
.
-