
Splunk APM during the four runs (29 Nov, 16:07 to 16:18 Brussels time). The two runs after 4:13 PM used file_storage; Splunk APM counted 1,028 and 1,124 spans for them, against 453 and 415 in the two memory runs.
When Kubernetes deleted my gateway OpenTelemetry Collector's pod in the middle of a backend outage, a sending queue on disk (file_storage) brought back everything the old pod was holding: 1,120 and 1,095 spans, exactly the old pod's final queue. Every span the gateway had accepted arrived at the relay in front of Splunk, counted by trace and span ID, in both runs.
It also kept the spans the old pod took while it shut down. The pod went on accepting spans while it shut down (its last metrics read came 12.3 and 9.0 seconds after SIGTERM), so its queue grew from 992 and 960 spans to 1,120 and 1,095, and every one came back. With the same queue in memory, those spans and the whole backlog went with the pod: the replacement started empty, and 1,204 and 1,152 accepted spans never arrived.
What I tested
A gateway Collector forwards traces to the backend. When the backend can't be reached, it keeps what it can't send in its sending queue, in memory by default.
A node drain, an eviction or a rollout can land during a backend incident. So I made both happen at once on EKS:
- telemetrygen sent spans to a gateway Collector (contrib 0.165.0), one span per request: 60 a second before the outage, measured in every run.
- About 10 seconds in, the gateway's export target went away. That's a small relay Collector, scaled to 0.
- About 30 seconds in, I deleted the gateway's pod. The script is set to delete it at 25 seconds; in these runs the delete came at 29 to 30 seconds. A one-pod StatefulSet started the replacement on the same node.
- The relay was set to come back 40 seconds in, but the script waited until the old pod was gone, so the old pod couldn't send its queue on its way out. In these runs the old pod was gone at 41 to 45 seconds, and the relay was scaled back at 44 to 49 seconds and ready at 46 to 51 seconds: outages of 32 to 38 seconds.
Both configs are the queue I sized in last week's batching lab: exporter batching, sizer: items, queue_size: 100000. The only change is where the queue lives. Two runs each.
I counted three ways: the gateway's own metrics, every span the relay received (counted by trace and span ID, so a duplicate counts once), and Splunk APM.

The gateway pod in Splunk Observability Cloud's Kubernetes view: a terminated OpenTelemetry Collector container (otel) and the one that replaced it, each with its scrape sidecar.
With the queue in memory, the replacement starts empty
The old pod took 14 and 16 seconds to shut down. A sidecar kept reading the gateway's metrics until it stopped answering. In its last read, the queue had gone from 1,073 and 1,024 spans to 16, and the gateway's sent count hadn't moved (704 and 736). The queued spans weren't sent anywhere. The lab measured that they were gone, not how the Collector let go of them while shutting down.
Across both pods, the gateway accepted 2,111 and 1,983 spans. The relay received 907 and 831.

With file_storage, the replacement picks up the queue
With the queue on disk, the new pod's first log lines show it loading the queue:
info queue/persistent_queue.go:186 Loaded queue metadata ...
info queue/persistent_queue.go:454 Fetching items left for dispatch by consumers ...
It brought back 1,120 and 1,095 spans, exactly the old pod's final queue (a difference of 0 in both runs). After the outage, the gateway sent 2,056 of 2,056 and 2,251 of 2,251 accepted spans. The relay received the same numbers, with no duplicates.
The restart took as long either way: Ready 16 and 18 seconds after the delete in memory, 17 and 14 on disk. After the relay returned, the queue was back to normal in 7 to 10 seconds in every run.

What no queue setting can hold
Plan for this one too: 291 and 289 spans in the memory runs, 288 and 325 in the disk runs were generated by the sender and never accepted by either gateway pod. A queue only holds what the Collector has received. The sender also generated fewer than 3,000 spans in 50 seconds in every run (2,272 to 2,576); the lab didn't measure why. I didn't test what covers that gap, such as a second gateway replica or retries in the sender.
The numbers
| Run | Sent by the app | Accepted | Queue at the delete | Queue in the old pod's final read | Brought back | Arrived at the relay | Accepted, never arrived |
|---|---|---|---|---|---|---|---|
| memory-1 | 2,402 | 2,111 | 1,073 | 16 | 0 | 907 | 1,204 |
| memory-2 | 2,272 | 1,983 | 1,024 | 16 | 0 | 831 | 1,152 |
| disk-1 | 2,344 | 2,056 | 992 | 1,120 | 1,120 | 2,056 | 0 |
| disk-2 | 2,576 | 2,251 | 960 | 1,095 | 1,095 | 2,251 | 0 |
Both configs held a similar backlog at the delete.
The lab's own summary, from the AWS run:
run rate/s generated accepted sent relay_unq relay_all q_before restored ready_s acc_unsent drain_s complete
memory-1 60.0 2402 2111 907 907 907 16 0 16 1204 7 1
memory-2 60.0 2272 1983 831 831 831 16 0 18 1152 9 1
disk-1 60.0 2344 2056 2056 2056 2056 1120 1120 17 0 10 1
disk-2 60.0 2576 2251 2251 2251 2251 1095 1095 14 0 7 1
Splunk APM, further down the line: 453 and 415 spans for the load service in the memory runs, 1,028 and 1,124 in the disk runs. In every run that's about half the relay's count, within 2 spans. The lab read the same count split by span kind, and both parts read 0, so it doesn't explain the factor of 2. As a relative check it agrees with the relay: disk-1 held 2.27 times as many spans as memory-1 in both counts. The program, per run window:
data('spans.count', filter=filter('sf_environment', '<lab name>') and filter('sf_service', 'checkout-load'), rollup='delta').sum().publish()

Try it yourself
The disk config adds the extension and one line to the exporter:
extensions:
file_storage:
directory: /var/lib/otelcol/queue/${env:LAB_RUN}
create_directory: true
exporters:
otlphttp:
endpoint: http://relay:4318
retry_on_failure:
max_interval: 5s
sending_queue:
storage: file_storage
sizer: items
queue_size: 100000
batch:
enabled: true
service:
extensions: [file_storage]
In this lab, an init container hands the node directory to user and group 10001, the user the Collector runs as:
initContainers:
- name: queue-dir
image: public.ecr.aws/docker/library/busybox:1.36
command: ["sh", "-c", "chown 10001:10001 /q && ls -lnd /q"]
The load:
telemetrygen traces --otlp-http --otlp-endpoint=gateway.demo.svc.cluster.local:4318 --otlp-insecure \
--batch=false --workers=4 --rate=15 --duration=50s --service=checkout-load --allow-export-failures
Things to plan for:
- A StatefulSet starts the replacement only after the old pod is gone, so two Collectors never open the same queue files.
- A hostPath ties the queue to one node. If the pod moves, it starts empty there. A PersistentVolume follows the pod.
- I didn't measure the disk's CPU and I/O cost.
- I capped the retry interval at 5 s in both configs so drains were comparable.
- One setup: one pod on one node, one load shape, one restart point, two runs each.
Every script and the raw output of every run are in the lab folder.
Every file in this lab
Everything above runs from these files. Open any of them to copy it, or clone the repo as shown:
README.mdcheck-run.shcheck.shcleanup.shfix.shk8s/20-load.yamlk8s/30-gateway.yamlk8s/40-stats.yamllib.shmain.tfmeasure.shproviders.tfreproduce.shrestart.shsplunk.shevidence/: the raw output of my run
Sources
- Resiliency, OpenTelemetry Collector docs
- Data Persistence in the OpenTelemetry Collector, Splunk Community Blog
- Restart with a large file_storage backlog, opentelemetry-collector-contrib issue 52868
I work at Splunk, part of Cisco. Views are my own.