Class BatchSpanProcessor

  • All Implemented Interfaces:
    SpanProcessor, java.io.Closeable, java.lang.AutoCloseable

    public final class BatchSpanProcessor
    extends java.lang.Object
    implements SpanProcessor
    Implementation of the SpanProcessor that batches spans exported by the SDK then pushes them to the exporter pipeline.

    All spans reported by the SDK implementation are first added to a synchronized queue (with a maxQueueSize maximum size, if queue is full spans are dropped). Spans are exported either when there are maxExportBatchSize pending spans or scheduleDelayNanos has passed since the last export finished.

    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • WORKER_THREAD_NAME

        private static final java.lang.String WORKER_THREAD_NAME
      • SPAN_PROCESSOR_TYPE_LABEL

        private static final AttributeKey<java.lang.String> SPAN_PROCESSOR_TYPE_LABEL
      • SPAN_PROCESSOR_DROPPED_LABEL

        private static final AttributeKey<java.lang.Boolean> SPAN_PROCESSOR_DROPPED_LABEL
      • SPAN_PROCESSOR_TYPE_VALUE

        private static final java.lang.String SPAN_PROCESSOR_TYPE_VALUE
      • exportUnsampledSpans

        private final boolean exportUnsampledSpans
      • isShutdown

        private final java.util.concurrent.atomic.AtomicBoolean isShutdown
    • Constructor Detail

      • BatchSpanProcessor

        BatchSpanProcessor​(SpanExporter spanExporter,
                           boolean exportUnsampledSpans,
                           MeterProvider meterProvider,
                           long scheduleDelayNanos,
                           int maxQueueSize,
                           int maxExportBatchSize,
                           long exporterTimeoutNanos)