Persistent queue recovery verification limits in OpenTelemetry Collector
0 reputation · 28 Sept 2020, 13:12 UTC
0 reputation · 28 Sept 2020, 13:12 UTC
The OpenTelemetry Collector can buffer spans, metrics, and logs to disk using the file_storage extension and a persistent queue so that telemetry survives a backend outage and drains after restart. The queue provides at-least-once delivery, which means an unclean shutdown may cause the Collector to resend events already accepted by the backend.
The Collector does not expose a built-in checksum, manifest, or reconciliation report comparing recovered data against data originally received. Operators must infer completeness from backend-side counts or exporter telemetry, and it is unclear whether that inference is sufficient for environments requiring strict recovery verification.
Can recovered queue data be verified for completeness without external tooling? What Collector metrics or log fields best indicate that a persistent queue has fully drained after restart? Are there documented limits on reconciling duplicates or gaps after an unclean shutdown?
34775 reputation · 28 Sept 2020, 15:13 UTC
The Collector does not provide a built-in checksum, manifest, or reconciliation report for the file_storage-backed persistent queue. Completeness cannot be verified internally without external tooling; it must be inferred from Collector metrics and exporter telemetry. There are no documented hard limits on duplicate reconciliation; the practical limit is backend ingest capacity and Collector disk and memory during replay.
Because the queue is file-backed, the Collector replays items after restart until exporter send succeeds. Duplicate telemetry can occur if acknowledgment was received before an unclean shutdown but not persisted in the Collector's in-memory state. Gaps are unlikely unless disk fills or the queue file is corrupted, but the Collector does not report gaps explicitly.
One missing diagnostic detail that changes the recommendation: which exporter is in use. Metric names for send success and failure vary by exporter, and some backends expose deduplication signals that strengthen verification.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 28 Sept 2020, 16:42 UTC
The most reliable signal that a persistent queue has fully drained after restart is the otcol_persistentqueue_queued_items metric (or its per-signal variants _spans, _metrics, _logs) returning to zero and remaining there for longer than the configured export interval. In Collector versions ≥0.100 this metric is emitted by the file_storage extension when the write-ahead log is replayed and truncated. Operators should also confirm the WAL file (typically datafile.otlp in the storage directory) shrinks to zero bytes and that no "failed to replay WAL" errors appear in the logs. Comparing the delta of otcol_exporter_sent_spans against the pre-shutdown queued count can indicate loss, but only if exporter telemetry is enabled; disabling metric export removes this visibility. Note that at-least-once semantics mean duplicates are bounded by the WAL size at crash time—downstream systems must handle deduplication for non-idempotent endpoints.