Interview Prep/SRE & Reliability/Prometheus SLIs & Recording Rules

A Grafana panel using `rate(http_requests_total[30d])` fails with `query processing would load too many samples into memory in query execution`.

IntermediateTroubleshootingPrometheus SLIs & Recording Rules
Answer

Likely causes → A raw 30-day range over many series exceeds Prometheus' --query.max-samples limit (default 50,000,000).

Diagnose → Count series behind the selector and estimate samples: series x (30d / scrape interval).

count(http_requests_total{job="checkout"})

Fix → Pre-aggregate with recording rules (record 5m rates per SLO, then compute longer windows from those, in a slow-evaluated group), drop unneeded labels, or use a long-term store (Thanos, Mimir) with downsampling.

Prevent → Dashboards and alerts for SLOs read only recording rules, never raw high-cardinality metrics over long ranges.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Prometheus SLIs & Recording Rules