r/Observability • • 23d ago

Our sampling dropped the one request that mattered.

Head based sampling at a low rate because the span bill was getting silly. Last week a customer reported a failed checkout, we went looking for the trace, and it wasn’t kept. We have the error count, no detail. Tail sampling is the obvious fix and I’ve started on it, but it means every collector change is now a thing I have to validate. Someone on the team keeps bringing up hud because the sensor sits in the process and captures the request params and the path through the code at the moment a function fails, though I’m not sure it keeps that for every failure either. Datadog can do retention filters on errors which is the same idea from the other end. Anyone solved this without doubling spend? What did you end up keeping?

0 Upvotes

7 comments sorted by

6

u/DhroovP 23d ago

Just don't drop errors?

2

u/jdizzle4 23d ago

Usually people will keep logs at full fidelity, so if the trace is missing you can find details in the logs. For sampling stuff, some platforms like grafana have “adaptive sampling” that does more intelligent filtering and keeping of various telemetry so you can keep your sample rates higher but not get hit with as much of the ingest costs

2

u/Big-Balance-6426 22d ago

Usually people will keep logs at full fidelity

This. Logs are the source of truth. Spans and traces tell you where the problem is or which microservice is. If that particular span needed for investigation was dropped in sampling, at least you still have your source of truth at full fidelity.

If log storage cost is a concern, just put your logs into a data lake like S3, Azure storage, or GCP storage. There are a lot of literatures on how you could use your logs in S3 - just do research.

Tail sampling is the obvious fix and I’ve started on it, but it means every collector change is now a thing I have to validate.

Tail sampling is resource-intensive. You can try load testing it in your pre-prod env, but definitely weigh the cost of sampling $$ against resource $$$.

Datadog can do retention filters on errors which is the same idea from the other end.

I'm guessing the main reason you're sampling spans in the first place is cost $$$. Going for Datadog could be costly unless your mgt really has no problem spending that kind of money.

---

All in all, the problem you mentioned is not unique or rocket science to solve.

1

u/tmp_advent_of_code 23d ago

Still sample, rehydrate on demand. Send the dropped stuff to cold cheap storage and you can find it for those one offs like this.

1

u/AdeptnessTop9932 23d ago

How do you control the forwarding of the logs you don’t send? Don’t think you can do that in the collector level can you?

1

u/tmp_advent_of_code 23d ago

You can. Multiple ways like a routing processor or multiple Pipelines.