rate(http_requests_total[5m] @ 1609746000)
#This returns the 5-minute rate that http_requests_total had at 2021-01-04T07:40:00+00:00
Hi.Can anyone explain to me what does the above sentence mean? I am newbie to prometheus and i am a little confused about the exact time in the rate function.
rate
is applied to the range vector selected by inner query.
So let's compare the difference between: http_requests_total[5m] @ 1609746000
and http_requests_total[5m]
.
First one creates a range vector with values of time series with name http_requests_total
over five minute window that ends at 1609746000 regardless of the time parameter.
Second one creates a range vector with values of time series with name http_requests_total
over five minute window that ends at the time parameter of the query.
This means, that graph of rate
over first selector will always be a constant horizontal line, regardless of time range for your graph (as result is not dependent on that time at all), and for second one it will calculate rate over last 5 minutes for each point on graph. Demo