I am trying to follow up on this question that has a great explanation about counter/rate/increase work in prometheus/grafana ... but I still cannot reconcile it with my observations :/
Here is a plot of the raw counter overtime. Samples are every 15s, and there is a single increase at 5:55:00 from 7361 to 7370:
Now, this is the plot of rate(counter[2m])
over the same interval:
It shows 4 rate samples of 0.15 between 05:55:00 and 05:55:45. 0.15/second is 9 per minute, but requested interval is two minutes not one.
Consequently, if I replace rate
with increase
in this query, it shows 18 rather than 9, which is twice what I expect.
Also, if I do rate(counter[1m])
(rather than 2m
), then I get no data at all.
I ended up doing rate(counter[2m])*60)
which seems to be showing proper increase value within a minute interval, but (1) this seems ... clumsy: why do I have to do this??? and (2) why can I not use less than 2m interval, if my samples are every 15s?
I have been pulling what's left of my hair out over this for way longer than I would like to. Any help would be much appreciated.