Subquery `max_over_time(rate(x[5m])[1d:])` is extremely slow
AdvancedTroubleshootingPromQL and recording rules
Answer
Likely causes → Without an explicit resolution, the subquery uses the global evaluation interval, computing rate at thousands of points per series.
Diagnose → Check query time in the Prometheus UI stats and the series count.
Fix → Set resolution [1d:5m], or better, create a recording rule for rate(x[5m]) and run max_over_time over that.
Prevent → Ban raw subqueries in alerts; use recording rules.
More on PromQL and recording rules
A PromQL query in the UI returns `Empty query result` for a metric you can see on `/metrics`Beginner`rate(http_requests_total[1m])` returns nothing but `http_requests_total` has dataBeginner`rate()` applied to a gauge shows huge spikesBeginnerBinary operation fails: `many-to-many matching not allowed: matching labels must be unique on one side`Advanced`found duplicate series for the match group {pod="api-1"} on the right hand-side of the operation`IntermediateError ratio query returns no data during quiet hoursIntermediate