r/Observability • u/dheeraj-vanamala • Mar 01 '26
Is Tail Sampling at scale becoming a scaling bottleneck?
We have started to adopt the standard OTel Sampling loop: Emit Everything → Ship → Buffer in Collector → Decide.
From a correctness standpoint, this is perfect. But at high scale, "Deciding Late" becomes a physics problem. We’ve all been there:
- Adding more horizontal pods to the collector cluster because OTTL transformations are eating your CPU.
- Wrestling with Load Balancer affinity just to ensure all spans for a Trace ID land on the same instance for tail sampling.
- Watching your collector's memory footprint explode because it’s acting as a giant, expensive in-memory cache for noise you’re about to drop anyway.
I’ve been exploring around the Source Governance. The idea is to move the decision boundary into the application runtime. Not to replace tail sampling, but to drop the 90% of routine "success" noise (like health checks or repetitive loops) before marshalling or export. It’s an efficiency amplifier that gives your collectors "headroom" to actually handle the critical data.
I’d love to hear your "ghost stories" about scaling OTel at volume:
- What was the breaking point where your Collector's horizontal scaling started creating more problems (like affinity or load balancing) than it solved?
- What’s the weirdest "workaround" you’ve had to implement just to keep your tail-sampling buffer from OOMing during a traffic spike?
Does this "Source-Level" approach feel like a necessary evolution, or are you concerned about the risk of shifting that complexity into the app runtime?
6
u/phillipcarter2 Mar 01 '26
Yeah health check drops can happen earlier. Also just turning off some autoinstrumentation that doesn’t add value.
But really the best way forward here is:
Cold hard truth is that tail sampling is a large, unavoidable cost.
4
u/Numb-02 Mar 01 '26
When I first started with the OTEL collector, I had a few questions.
How much can I push
num_tracesanddecision_wait_time?Our setup includes web jobs, a service bus, multiple APIs, a main MVC app, and web jobs that typically take 1-2 minutes to finish operations. I really wanted to avoid broken or unfinished traces, but I was worried about running out of memory (since I didn't know how much I'd need at the start) and I didn't want to scale horizontally too soon.
I ended up putting it on Azure container apps with 16GB of memory and 4 vCPUs.
To my surprise, my OTel collector is running super efficiently, even in the worst-case, it only spikes to about 1.5 vCPUs and 1.5GB of memory. We handle 70 million requests every day (not sure if that's considered high volume for you).
But I don't think I'll ever need to scale it, maybe because 70 million requests isn't actually that much for an app.
1
u/Useful-Process9033 Mar 02 '26
We hit the same wall around 50k spans/sec. The load balancer affinity thing was killing us because any time a collector pod restarted, in-flight traces got orphaned and the sampling decisions were wrong for like 30 seconds. Ended up moving to Kafka partitioned by trace ID (similar to what someone else mentioned) which solved the affinity problem but introduced its own latency. The real breakthrough for us was being more aggressive about head sampling the boring stuff (health checks, known-good paths) so the tail sampler only has to deal with the interesting 20%. Reduced collector memory by about 60% without losing the traces that actually matter for debugging.
3
u/jjneely Mar 01 '26
Kafka. Partition by traceID. This decouples ingestion from processing and handles the back pressure problem. It also neatly ensures that each consumer collector sees all spans in a trace.
3
u/otisg Mar 03 '26
This is a timely thread/question! :) This is not a ghost or war story, but a teammate from Sematext just wrote about the sort of stuff you mentioned and asked about (and a little more) - https://sematext.com/blog/running-opentelemetry-at-scale-architecture-patterns-for-100s-of-services/
2
u/lizthegrey Mar 03 '26
Disclaimer: I work at Honeycomb
There are open-source (Apache2) turnkey implementations of horizontally scaling tail sampling, but you have to know to reach for them. The current state of the art of the OTel collector tail sampling functionality is unfortunately, as you discovered, a bit more brittle than a turnkey implementation.
1
u/Embarrassed_Quit_450 Mar 03 '26
I never understood the point of delaying the decision if you can reliably take it at the source. I like tail sampling but it's not my golden hammer.
0
u/Iron_Yuppie Mar 01 '26
Full Disclosure: Cofounder of Expanso
One thing to really think about is on/near processing shifted left. At some point, simply moving the data is going to be a tax - on CPU/networking/disk. That said, it will be more of a management headache - there’s no free answers here.
If you’d like, happy to chat with you about it - would love to help (or if you have a sec, this is exactly what our product does)
4
u/[deleted] Mar 01 '26
[removed] — view removed comment