Class BatchSpanProcessorBuilder


  • public final class BatchSpanProcessorBuilder
    extends java.lang.Object
    Builder class for BatchSpanProcessor.
    • Field Detail

      • DEFAULT_SCHEDULE_DELAY_MILLIS

        static final long DEFAULT_SCHEDULE_DELAY_MILLIS
        See Also:
        Constant Field Values
      • DEFAULT_MAX_EXPORT_BATCH_SIZE

        static final int DEFAULT_MAX_EXPORT_BATCH_SIZE
        See Also:
        Constant Field Values
      • DEFAULT_EXPORT_TIMEOUT_MILLIS

        static final int DEFAULT_EXPORT_TIMEOUT_MILLIS
        See Also:
        Constant Field Values
      • exportUnsampledSpans

        private boolean exportUnsampledSpans
      • scheduleDelayNanos

        private long scheduleDelayNanos
      • maxQueueSize

        private int maxQueueSize
      • maxExportBatchSize

        private int maxExportBatchSize
      • exporterTimeoutNanos

        private long exporterTimeoutNanos
    • Constructor Detail

      • BatchSpanProcessorBuilder

        BatchSpanProcessorBuilder​(SpanExporter spanExporter)
    • Method Detail

      • setExportUnsampledSpans

        public BatchSpanProcessorBuilder setExportUnsampledSpans​(boolean exportUnsampledSpans)
        Sets whether unsampled spans should be exported. If unset, defaults to exporting only sampled spans.
        Since:
        1.34.0
      • setScheduleDelay

        public BatchSpanProcessorBuilder setScheduleDelay​(long delay,
                                                          java.util.concurrent.TimeUnit unit)
        Sets the delay interval between two consecutive exports. If unset, defaults to 5000Lms.
      • setScheduleDelay

        public BatchSpanProcessorBuilder setScheduleDelay​(java.time.Duration delay)
        Sets the delay interval between two consecutive exports. If unset, defaults to 5000Lms.
      • getScheduleDelayNanos

        long getScheduleDelayNanos()
      • setExporterTimeout

        public BatchSpanProcessorBuilder setExporterTimeout​(long timeout,
                                                            java.util.concurrent.TimeUnit unit)
        Sets the maximum time an export will be allowed to run before being cancelled. If unset, defaults to 30000ms.
      • setExporterTimeout

        public BatchSpanProcessorBuilder setExporterTimeout​(java.time.Duration timeout)
        Sets the maximum time an export will be allowed to run before being cancelled. If unset, defaults to 30000ms.
      • getExporterTimeoutNanos

        long getExporterTimeoutNanos()
      • setMaxQueueSize

        public BatchSpanProcessorBuilder setMaxQueueSize​(int maxQueueSize)
        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:
        DEFAULT_MAX_QUEUE_SIZE
      • getMaxQueueSize

        int getMaxQueueSize()
      • setMaxExportBatchSize

        public BatchSpanProcessorBuilder setMaxExportBatchSize​(int maxExportBatchSize)
        Sets the maximum batch size for every export. This must be smaller or equal to maxQueueSize.

        Default value is 512.

        Parameters:
        maxExportBatchSize - the maximum batch size for every export.
        Returns:
        this.
        See Also:
        DEFAULT_MAX_EXPORT_BATCH_SIZE
      • getMaxExportBatchSize

        int getMaxExportBatchSize()