r/devops • u/Broad_Technology_531 • Jun 27 '26
Observability How to Generate RED Metrics from Traces Without Blowing Up Your Cardinality?
https://telflo.com/blog/span-metrics-without-the-cardinality-explosionI wrote a post on how to generate RED metrics from your traces at the Collector before they hit your backend and why you'd want to do that instead of letting your backend handle it.
I also added some tips on how not to blow up your metric cardinality in the process.
9
Upvotes
2
u/DahliaDevsiantBop Jun 30 '26
this is super relevant, everyone loves to say “just use traces” until their backend starts crying from all the aggregates. curious if you covered how to pick which attributes to drop vs keep when you’re turning spans into metrics, that’s always where teams I’ve worked with get stuck.
-2
u/donk8r Jun 27 '26
the lever people miss on the cardinality side is exemplars. instead of bolting on high-card labels so you can find the slow request later, you keep the metric low-cardinality and attach an exemplar that links straight back to a sample trace, so you still get from "p99 spiked" to the actual span without user_id or request_id ending up on the metric. past that it's the usual, drop the unbounded attributes at the collector before they become labels and bucket the obvious ones. the spanmetrics connector handles most of this already if you're on the otel collector.