Class ExecutorServiceSpanProcessorBuilder
- java.lang.Object
-
- io.opentelemetry.sdk.extension.incubator.trace.ExecutorServiceSpanProcessorBuilder
-
public class ExecutorServiceSpanProcessorBuilder extends Object
Builder class for theExecutorServiceSpanProcessor
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorServiceSpanProcessor
build()
Returns a newExecutorServiceSpanProcessor
that batches, then converts spans to proto and forwards them to the givenspanExporter
.ExecutorServiceSpanProcessorBuilder
setExporterTimeout(long timeout, TimeUnit unit)
Sets the maximum time an export will be allowed to run before being cancelled.ExecutorServiceSpanProcessorBuilder
setExporterTimeout(Duration timeout)
Sets the maximum time an export will be allowed to run before being cancelled.ExecutorServiceSpanProcessorBuilder
setMaxExportBatchSize(int maxExportBatchSize)
Sets the maximum batch size for every export.ExecutorServiceSpanProcessorBuilder
setMaxQueueSize(int maxQueueSize)
Sets the maximum number of Spans that are kept in the queue before start dropping.ExecutorServiceSpanProcessorBuilder
setScheduleDelay(long delay, TimeUnit unit)
Sets the delay interval between two consecutive exports.ExecutorServiceSpanProcessorBuilder
setScheduleDelay(Duration delay)
Sets the delay interval between two consecutive exports.ExecutorServiceSpanProcessorBuilder
setWorkerScheduleInterval(long interval, TimeUnit unit)
Sets the delay interval between two consecutive runs of the worker job.ExecutorServiceSpanProcessorBuilder
setWorkerScheduleInterval(Duration interval)
Sets the delay interval between two consecutive runs of the worker job.
-
-
-
Method Detail
-
setScheduleDelay
public ExecutorServiceSpanProcessorBuilder setScheduleDelay(long delay, TimeUnit unit)
Sets the delay interval between two consecutive exports. If unset, defaults to 5000Lms.
-
setScheduleDelay
public ExecutorServiceSpanProcessorBuilder setScheduleDelay(Duration delay)
Sets the delay interval between two consecutive exports. If unset, defaults to 5000Lms.
-
setExporterTimeout
public ExecutorServiceSpanProcessorBuilder setExporterTimeout(long timeout, TimeUnit unit)
Sets the maximum time an export will be allowed to run before being cancelled. If unset, defaults to 30000ms.
-
setExporterTimeout
public ExecutorServiceSpanProcessorBuilder setExporterTimeout(Duration timeout)
Sets the maximum time an export will be allowed to run before being cancelled. If unset, defaults to 30000ms.
-
setMaxQueueSize
public ExecutorServiceSpanProcessorBuilder setMaxQueueSize(int maxQueueSize)
Sets the maximum number of Spans that are kept in the queue before start dropping.See the BatchSampledSpansProcessor class description for a high-level design description of this class.
Default value is
2048
.- Parameters:
maxQueueSize
- the maximum number of Spans that are kept in the queue before start dropping.- Returns:
- this.
- See Also:
DEFAULT_MAX_QUEUE_SIZE
-
setMaxExportBatchSize
public ExecutorServiceSpanProcessorBuilder setMaxExportBatchSize(int maxExportBatchSize)
Sets the maximum batch size for every export. This must be smaller or equal tomaxQueuedSpans
.Default value is
512
.- Parameters:
maxExportBatchSize
- the maximum batch size for every export.- Returns:
- this.
- See Also:
DEFAULT_MAX_EXPORT_BATCH_SIZE
-
setWorkerScheduleInterval
public ExecutorServiceSpanProcessorBuilder setWorkerScheduleInterval(Duration interval)
Sets the delay interval between two consecutive runs of the worker job. If unset, defaults to 100000ns.
-
setWorkerScheduleInterval
public ExecutorServiceSpanProcessorBuilder setWorkerScheduleInterval(long interval, TimeUnit unit)
Sets the delay interval between two consecutive runs of the worker job. If unset, defaults to 100000ms.
-
build
public ExecutorServiceSpanProcessor build()
Returns a newExecutorServiceSpanProcessor
that batches, then converts spans to proto and forwards them to the givenspanExporter
.- Returns:
- a new
ExecutorServiceSpanProcessor
. - Throws:
NullPointerException
- if thespanExporter
isnull
.
-
-