TelemetryRepositoryImpl constructor
TelemetryRepositoryImpl(})
Creates a new TelemetryRepositoryImpl instance.
The _ffi parameter provides access to native OpenTelemetry functions.
batchSize specifies how many items to buffer before auto-flush.
flushInterval specifies how often to auto-flush buffered data.
maxRetries specifies the maximum number of retry attempts for exports.
retryBaseDelay is the initial delay before first retry.
retryMaxDelay is the maximum delay between retries.
fallbackExporter optional exporter to use when OTLP fails.
Implementation
TelemetryRepositoryImpl(
this._ffi, {
int batchSize = 100,
Duration flushInterval = const Duration(seconds: 30),
int maxRetries = 3,
Duration retryBaseDelay = const Duration(milliseconds: 100),
Duration retryMaxDelay = const Duration(seconds: 10),
}) : _buffer = TelemetryBuffer(
batchSize: batchSize,
flushInterval: flushInterval,
),
_retry = _RetryHelper(
maxRetries: maxRetries,
baseDelay: retryBaseDelay,
maxDelay: retryMaxDelay,
) {
_buffer.onFlush = _exportBatch;
}