Published
How to Validate OpenTelemetry Collector Persistent Queues During Backend Outages
Validate OpenTelemetry Collector persistent queues through backend outages and restarts, measure queue recovery, and identify telemetry loss before rollout.
A telemetry gateway can report healthy receivers while its destination is unavailable. Applications continue sending logs, metrics, or spans, yet the backend receives nothing. After connectivity returns, the queue may drain, overflow, or discard old requests. A green Collector process and a successful restart are not evidence that the missing interval arrived. The engineering problem is to demonstrate what the pipeline accepted, what it persisted, what it retried, and what the destination actually stored.
This guide defines a reproducible validation method for an OpenTelemetry Collector gateway using a persistent exporter sending queue. It focuses on a planned backend outage followed by Collector restart, not on general telemetry filtering or cardinality control. The design should be validated against the exact Collector distribution and version deployed. Queue behavior, batching configuration, and emitted metric names can change between versions.
Draw the failure boundary before changing configuration
Document the actual path: application or node agent -> receiving Collector -> processing pipeline -> exporter sending queue -> destination backend. Mark every network hop, queue, storage volume, retry boundary, and independently managed failure domain. An agent forwarding to a gateway and a gateway forwarding to the backend have different reliability requirements. Making the gateway durable does not automatically preserve records that an upstream agent discarded before delivery.
Decide which signal is being validated first. Use a controlled stream of synthetic spans or log records with unique sequence identifiers, source timestamps, and known production rate. A test receiver able to query those identifiers is much stronger than a dashboard showing aggregate requests per second. Keep security logs and production identifiers out of synthetic experiments. Capture the configuration revision, Collector binary version, distribution, destination type, and the owner of each hop.
Separate retry behavior from durable storage
The OpenTelemetry Collector resiliency guidance describes exporter sending queues and retry-on-failure as distinct mechanisms. In-memory queues can absorb transient destination delays, but their contents do not survive a process crash. A persistent queue uses the file_storage extension to retain queued work on disk so that a Collector instance can resume it after restart. This is a reliability feature, not a guarantee of exactly-once delivery.
Validate the three loss boundaries separately: an upstream request that the receiver refuses, a request that cannot enter the export queue, and a queued request that exceeds retry or storage limits. A retry log means an attempt failed, not necessarily that the record was permanently lost. Conversely, a successful receiver response alone does not establish that the downstream system indexed the record. The endpoint can be down longer than the configured retry window, storage can fill, and malformed requests may be rejected permanently.
Configure a real persistent queue
Use a Collector distribution that includes the file_storage extension. The extension documentation identifies its directory and permissions requirements; its working directory must exist and be writable. Configure one dedicated storage directory for the Collector instance, mount it on persistent storage, include the extension in service.extensions, and reference its component name through the exporter’s sending_queue.storage setting. Keep the directory outside ephemeral container layers and outside paths that are replaced by routine deployments.
Treat each gateway replica as a separate queue owner. Do not point multiple independent processes at the same mutable local queue directory. Record how the workload scheduler reconnects a restarted instance to its original volume. A rescheduled pod using a different empty volume may boot successfully while the old queued data remains inaccessible. For Kubernetes, verify the volume claim, access mode, pod identity, disruption handling, and restart sequence in the actual deployment model rather than assuming that a persistent-volume label proves recovery.
Set explicit exporter retry behavior and review limits for the deployed version. Do not silently inherit defaults and then design an outage exercise longer than the configured retry duration. Protect filesystem access, monitor free space and write errors, and establish a backup or rebuild policy for configuration separately from queued telemetry data. A durable directory is not a backup of a complete observability system.
Size the queue in the units it actually uses
First measure the incoming rate, average request size after processing, maximum burst, and normal exporter throughput. Estimate the data produced during an outage as input bytes per second multiplied by the outage duration, then add headroom for bursts, storage metadata, and delayed catch-up. This produces a disk-capacity estimate, not a valid queue_size value on its own. Some Collector queue configurations express capacity in requests, while newer mechanisms can size by items or bytes; the 2026 OpenTelemetry batching guidance highlights why the distinction matters.
If the queue counts requests, determine the observed items and bytes per request under the deployed batching configuration. Increasing queue_size by a factor of ten is not equivalent to increasing the protected outage window by ten if batch shape changes. Capture measured request-size distributions, not only averages. Compare the forecast queue growth with disk limits and the backend’s sustainable drain rate before changing concurrency. Larger buffers postpone failure but cannot solve a permanently undersized destination.
Establish a three-sided baseline
Run a steady synthetic flow while the destination is healthy. Collect ingress at the receiver, queue behavior at the exporter, and successful ingestion from the destination’s own query or storage interface. Measure normal delivery latency and the expected variability. Distinguish accepted spans, metric points, or log records from exporter requests; one request can contain many telemetry items. Record counter values and timestamps before fault injection so counter resets at Collector restart do not corrupt later comparisons.
OpenTelemetry internal telemetry documents otelcol_exporter_queue_size and otelcol_exporter_queue_capacity, along with enqueue_failed, send_failed, receiver_accepted, and exporter_sent metrics for individual signal types. Verify the actual exported names, labels, and units for your version and reader configuration. Prometheus counter names may include the _total suffix. Alert on sustained queue occupancy and enqueue failures, but do not treat a send_failed increment as a definitive loss count because that request may later succeed.
Run the outage and restart sequence
- Stage 1 - Confirm that an isolated backend or disposable receiver accepts the expected synthetic sequence and record its latest acknowledged identifier.
- Stage 2 - Block only the export path or make the disposable backend unavailable. Keep the Collector receivers and synthetic sender reachable so new records continue arriving.
- Stage 3 - Observe queue growth, retry attempts, storage growth, processor memory, and receiver acceptance. Note the first rejected or failed enqueue if capacity is exhausted.
- Stage 4 - While records remain queued, restart or deliberately terminate the Collector instance. Keep the persistent volume intact. Verify that the same instance mounts the same directory and that the queue is visible after startup.
- Stage 5 - Restore the backend, continue sending a bounded workload, and measure delivery and queue drain. Capture destination-side record identifiers, duplicates, gaps, and latency.
- Stage 6 - Restore the normal configuration and confirm that queue occupancy stabilizes, storage remains healthy, and no non-test traffic was diverted.
Use a fault window long enough to demonstrate persistence across restart but short enough to remain within the intentionally configured retry and capacity limits for the positive case. Run a separate negative control that intentionally exceeds a limit in a disposable environment. A positive result without a negative control may only show that the fault was too brief to exercise the critical condition.
Prove delivery using source identities
The strongest reconciliation key is a deterministic record identifier generated before the Collector receives a synthetic item. Export those IDs as appropriate test attributes, then compare the set submitted by the synthetic producer with the set returned by the destination. Classify each ID as present once, present more than once, or absent at the final observation cutoff. Include collection timestamps, ingestion timestamps, and backend query delay so late indexing is not mistaken for permanent loss.
Do not claim exactly-once delivery from exporter_sent or from a queue reaching zero. A batch can be acknowledged, retried, or duplicated depending on exporter and receiver behavior. Receiver and exporter counters can have different units, and restarts reset some process counters. Reconciliation should therefore include source-side production logs, gateway queue metrics, and the destination’s stored records. Where exact identifier search is unavailable, document the weaker coverage estimate instead of upgrading it into an absolute claim.
Measure whether the recovered backend can catch up
Recovery requires the sustained export throughput to exceed the ongoing incoming rate. If a backlog represents B records, the incoming rate is R_in records per second, and the effective destination ingestion rate is R_out, a simple capacity estimate is drain time approximately B / (R_out - R_in), but only when R_out is greater than R_in and the rates are reasonably stable. Use the observed backlog in records, not the number of queued requests, for that arithmetic.
Watch throttling responses, queue occupancy, retry behavior, CPU, memory, disk I/O, and backend ingest limits during catch-up. Raising exporter worker concurrency can shorten drain time only if the backend has spare capacity. OpenTelemetry scaling guidance explicitly warns that adding Collector capacity cannot repair a saturated network or destination database. If the backend repeatedly throttles or fails, reduce pressure, revise the ingestion contract, or increase destination capacity before increasing queue consumers.
Exercise the failure modes that invalidate a green result
- Retry expiration - Extend the backend outage past the configured maximum retry period in an isolated environment and confirm that loss is visible in metrics and the identifier reconciliation.
- Queue saturation - Produce enough data to fill the configured queue, then observe whether incoming work is refused or lost and whether upstream senders retry.
- Storage failure - Test a missing or unwritable directory and a bounded low-disk scenario without affecting shared host storage; capture the startup and runtime error states.
- Replica replacement - Restart through the real orchestrator and verify that the original volume and queued records return to the intended instance.
- Permanent destination rejection - Use a disposable endpoint that returns invalid-request or authentication failures; increasing queue depth should not be recorded as remediation.
- Version migration - Compare queue units, exporter-side batching, and metric exposure on both sides of an upgrade before carrying old thresholds into the new release.
These cases should produce distinct incident signals. A quiet monitoring dashboard during a synthetic overflow is an instrumentation defect, not evidence that the persistent queue is reliable. Preserve exporter logs and the configuration revision alongside the outcome, with secrets removed.
Roll out with explicit acceptance criteria
Define a maximum planned outage, maximum acceptable missing-record count, duplicate tolerance, recovery time, disk-headroom threshold, and alerting requirement before the experiment. For a critical telemetry path, a reasonable engineering choice is zero missing synthetic identifiers within the supported positive-case outage window, with every exception investigated. That is a locally chosen acceptance criterion, not an OpenTelemetry service guarantee. Repeat the procedure for each signal whose exporter or batching behavior differs.
Deploy the validated configuration to one representative gateway or failure domain, retain the previous configuration and image for rollback, and compare telemetry volume and resource usage under normal load. Review queue ownership and restart behavior after scheduler upgrades or storage changes. Record the final artifact set: configuration hash, version, fault timeline, accepted and rejected data counts, exporter queue history, volume identity, destination reconciliation, and sign-off from the pipeline owner. These records support operational assurance and evidence collection; they do not independently establish compliance, certification, or authorization.
The decision is not whether a persistent queue was enabled. It is whether a defined failure can occur, the queued work can survive it, the destination can catch up, and missing or duplicated telemetry can be detected using independent evidence.
Related resources
- OpenTelemetry Gateway Cardinality Control
- Prometheus Remote Write Backpressure Diagnosis
- Observability and Cost-Control Engineering
Sources
Continue reading
- How to Build an OpenTelemetry Gateway That Controls Cardinality Before Backend Ingestion
A practical OpenTelemetry Collector gateway design for controlling metric cardinality, filtering low-value telemetry, and protecting backend ingestion.
- How to Validate Loki Label Cardinality Before Migrating Kubernetes Logs
A practical Loki migration test for Kubernetes logs: measure indexed stream cardinality, preserve structured metadata, validate queries, and plan rollback.
- Prometheus Remote Write Backpressure: Diagnose Before Adding Shards
Diagnose Prometheus remote write backpressure with sender metrics, receiver errors and reversible queue changes before increasing shard concurrency.
Written by
Tymur Chmeruk
Cloud Security & Infrastructure Engineer · Baltimore–Washington Metro · [email protected]