UNPKG

1.42 kBTypeScriptView Raw
1import { Span } from '../Span';
2import { SpanProcessor } from '../SpanProcessor';
3import { BufferConfig } from '../types';
4import { ReadableSpan } from './ReadableSpan';
5import { SpanExporter } from './SpanExporter';
6/**
7 * Implementation of the {@link SpanProcessor} that batches spans exported by
8 * the SDK then pushes them to the exporter pipeline.
9 */
10export declare abstract class BatchSpanProcessorBase<T extends BufferConfig> implements SpanProcessor {
11 private readonly _exporter;
12 private readonly _maxExportBatchSize;
13 private readonly _maxQueueSize;
14 private readonly _scheduledDelayMillis;
15 private readonly _exportTimeoutMillis;
16 private _finishedSpans;
17 private _timer;
18 private _isShutdown;
19 private _shuttingDownPromise;
20 constructor(_exporter: SpanExporter, config?: T);
21 forceFlush(): Promise<void>;
22 onStart(_span: Span): void;
23 onEnd(span: ReadableSpan): void;
24 shutdown(): Promise<void>;
25 /** Add a span in the buffer. */
26 private _addToBuffer;
27 /**
28 * Send all spans to the exporter respecting the batch size limit
29 * This function is used only on forceFlush or shutdown,
30 * for all other cases _flush should be used
31 * */
32 private _flushAll;
33 private _flushOneBatch;
34 private _maybeStartTimer;
35 private _clearTimer;
36 protected abstract onShutdown(): void;
37}
38//# sourceMappingURL=BatchSpanProcessorBase.d.ts.map
\No newline at end of file