Interview Prep/Monitoring & Observability/PromQL and recording rules

`rate(http_requests_total[1m])` returns nothing but `http_requests_total` has data

BeginnerTroubleshootingPromQL and recording rules
Answer

Likely causes → The range window holds fewer than 2 samples. With scrape_interval: 60s, a 1m window often has only one sample.

Diagnose → count_over_time(http_requests_total[1m]) returns 1 or less.

Fix → Use a window of at least 4× the scrape interval ([4m] for 60s scrapes), or $__rate_interval in Grafana.

Prevent → Standardise on $__rate_interval in all dashboard panels.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL and recording rules