Prometheus Query function to retrieve the number of requests for last $period

16 views
Skip to first unread message

rajasree Sekar

unread,
Feb 9, 2021, 1:39:53 AM2/9/21
to Prometheus Users

Hi all

We have been exploring on all the Prometheus Query functions which can be useful to retrieve the number of requests for the last $period from a cumulative stats http_srv_req_count.

sum(http_srv_req_count) - sum(http_srv_req_count offset $period) >= 0

Can you confirm if the below function would help in the scenario as mentioned above.
idelta(http_srv_req_count[$period]) >= 0

  1. If not can you suggest a PromQL function to satisfy our requirement.
  2. if yes, whats the impact of $period in the idelta function. With our observation, can see that it takes the difference of last two samples everytime and show the result but when does the $period gets applied.
Reply all
Reply to author
Forward
0 new messages