Quote from Prometheus Count and sum of observations doc:
To calculate the average request duration during the last 5 minutes from a histogram or summary called http_request_duration_seconds, use the following expression:
rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_count[5m])
I should mention that I understand:
- what
ratefunction does - how instant vector is different from range vector
- that if I wanted to obtain average request duration increase rate I would definitely use that expression
However I'm not interested in the increase rate of request duration, but rather in the request duration itself!
Can someone explain why everybody while looking for average count/value in any given moment of time has to use a rate function, when it doesn't provide that?
P.S. there's seemingly a duplicate question with a checked answer, however all answers in it explain what rate function is, how it does what it does, etc. I already understand what rate function does. I just don't understand why we are supposed to use it in first place, especially when the result that it provides has nothing to do with what we're looking for.