What does `increase()` return and why is it sometimes a non-integer?
IntermediateConceptPromQL & Recording Rules
Answer
increase(x[1h]) is the total increase over the window; it is syntactic sugar for rate(x[1h]) * 3600. Because rate() extrapolates to the window boundaries (the first and last sample rarely sit exactly on the edges), increase() of an integer counter can return 4.8 instead of 5.
That is expected. For exact counts over long windows, use a recording rule or round it in the display. Prometheus 3.x has experimental xincrease/xrate-style functions that address some extrapolation complaints.
More on PromQL & Recording Rules
What are the PromQL data types?BeginnerWhat label matchers does PromQL support?BeginnerExplain `rate()`.Beginner`rate()` vs `irate()`: what is the difference?IntermediateWhy must you `rate()` before `sum()`, never the reverse?IntermediateHow do PromQL aggregation operators and `by`/`without` work?Beginner