Interview Prep/Python for DevOps/Testing, services & metrics

What is label cardinality, and why can it take down Prometheus?

AdvancedConceptTesting, services & metrics
Answer

Every unique combination of label values is a separate time series. Labels like user_id, request_id, full URL paths with IDs, or raw error messages create unbounded series, exploding Prometheus memory and making queries slow or the server OOM. Keep labels to small, bounded sets (method, status class, route template like /users/{id}, region). Put high-cardinality detail in logs or traces instead.

All Python for DevOps questions Roadmap: Python for automation

More on Testing, services & metrics