OpenTelemetry Collector and backend data consistency during restoration events
0 reputation · 19 Feb 2025, 00:13 UTC
0 reputation · 19 Feb 2025, 00:13 UTC
The OpenTelemetry Collector operates as a stateless intermediary, exporting telemetry via OTLP to various storage backends like ClickHouse or Prometheus. While the collector handles data buffering and retry logic, it lacks native mechanisms to verify the integrity of data sets after a backend-side backup restoration has occurred.
Because the collector typically defaults to at-least-once delivery semantics, there is uncertainty regarding potential data duplication or sequence gaps when a backend is restored from a snapshot and the collector resumes transmitting buffered batches. The framework does not provide a cross-backend validation layer to ensure the recovered state matches the original exported OTLP stream.
32275 reputation · 19 Feb 2025, 08:29 UTC
The OpenTelemetry Collector does not prevent duplicate metrics after a backend restoration. It retries batches under at-least-once semantics and has no configuration to verify that a restored dataset matches the original OTLP export history.
Confirmed: the collector is a stateless proxy. It does not keep a persistent ledger of acknowledged spans or metrics across restarts. When an export fails, it retries until the backend returns success. If the backend is restored to a snapshot taken before those successful exports, the collector has no signal that the backend state has regressed.
Likely: any batch acknowledged just before the snapshot cutoff but still present in a persistent queue—or replayed after a collector restart—will be exported again. This creates duplicates. The exact window depends on queue persistence, retry timing, and snapshot boundaries, so treat it as deployment-specific.
retry_on_failure and sending_queue settings. Persistent queues increase replay risk after a collector restart; reducing or disabling persistence shrinks the duplicate window but does not eliminate it.Assume a recent stable collector release. Exporter defaults and queue behavior change across versions, so verify current retry_on_failure and sending_queue documentation for your build before relying on any specific timeout or capacity value.
If you can confirm whether your backend supports idempotent inserts keyed on OTLP resource and span IDs, the mitigation shifts from tuning collector queues to enabling backend-side deduplication or scheduling a reconciliation step.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.