Obtaining request count over a given time interval

Hi there,

I’m using the Micrometer library within my SpringBoot app. This library provides the metric http_server_requests_seconds_count, which returns the count of HTTP requests for a defined URI and its type is summary. The query that I have used is:

sum(increase(http_server_requests_seconds_count{status=~“2…|3…”, method=“GET”, namespace="$namespace", pod_name=~"$pod_name", uri="/doit"}[$interval]))

From my understanding, this query would calculate the increase of requests for a given interval, for each pod and the add up the result.

However, I’ve discovered that $interval variable is not giving me the data that I require; the number of requests that have occurred for the interval selected. For example, if I select [1h] as the value of $interval, I would expect the query above to calculate the number of requests that took place in the last hour. However, what it actually does (from my understanding), is calculate the number of the data points grouped for that 1h interval, based on the time range selected.

It is all very confusing! Please help.

P.S. I’ve also tried specifying [1h] within the relative time box within my query, but this did not change the value, once that time surpassed. For example, if I set relative time to 1min and if I received 5 requests in the last min but then none thereafter, I would expect the number to return to zero (after the last min surpassed).

Hey Folks, can anyone help with the above? :slight_smile:

1 Like