How do I graph number of requests over time in prometheus/grafana?

I’m trying to do something that I’d assume is very simple. I’ve searched around and seen tons of answers that look super simple and people say it works, but its just simply giving wrong data or not showing all data.

I’ve got a spring boot application with a prometheus exporter. I need to graph the number of requests over time. Ideally, it would show 10 requests at 10:01am, 7 requests at 10:02am, etc.

My simple query for this currently is this:

increase(http_server_requests_seconds_count{app="my-app", uri!~"/actuator.*"}[1m])

I also have the Min time interval set at 1m.

The issue I am running into is that the graph is never accurate. I can use postman to simulate 10 requests within a few seconds. But then grafana won’t show 10 requests, it might show 6, or even 0! If I send 30 requests through postman, it shows 20. If I send just 2 or 3 requests, it won’t show any. And I can hit my prometheus exporter endpoint directly and see the value go up the exact number I am expecting. Grafana just doesn’t seem to care.

I feel like I have to be missing some super simple, but I’m just not seeing it.

I’d appreciate any help you can give.

Hi @appledes7,

Why do you use increase in your query? I would expect the query to return what you expect, the way it is written if you remove the increase part.

How else would I show an increase over time? I’ve seen tons of articles recommending the increase function. It just seems to be broken.