`increase(errors_total[1h])` shows `2.97` even though errors are whole numbers
BeginnerTroubleshootingPromQL and recording rules
Answer
Likely causes → Expected. increase() extrapolates to the window edges, so results are fractional.
Diagnose → Compare with errors_total - errors_total offset 1h for a rough raw difference.
Fix → Round for display (round(increase(...[1h]))) and do not treat it as an exact count.
Prevent → For exact counts use logs or a billing-grade system, not Prometheus.
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