Interview Prep/Monitoring & Observability/Cardinality Control & Cost

How do you build cost showback for observability?

AdvancedProductionCardinality Control & Cost
Answer

Attribute volume to owners: active series per namespace/team from the metrics backend, log bytes per service from the ingest pipeline, spans per service from the collector. Multiply by unit cost and publish a monthly dashboard per team.

sort_desc(count by (namespace) ({__name__=~".+"}))
sum by (service) (rate(loki_distributor_bytes_received_total[1d]))

Mimir per-tenant usage stats or vendor usage APIs (Datadog usage attribution by tag) make this easier. Visibility alone usually cuts volume 20–40%.

All Monitoring & Observability questions

More on Cardinality Control & Cost