Mandroid
Mandroid

Reputation: 7484

How to display increase() function result for promethus+grafana for every time window

I have following query:

sum(increase(mymetrics[10m]))

So, my aim is to find change in mymetrics(a counter) per 10m period, which this query does well.

But I am not sure how to display the value for every 10m time window in grafana for ,say last 5 hours. So I expect 30 such values(6*5). Grafana graph can't be a good fit as it doesn't use time window as X axis.

Any better way to achieve it?

Upvotes: 0

Views: 1383

Answers (1)

trallnag
trallnag

Reputation: 2376

You can do that in your case.

Use the min step parameter and set it to 10m. I would also recommend you to switch to $__interval as the range and $__rate_interval once Grafana 7.2 is released this month.

enter image description here

Notice that once you zoom out far enough your "time windows" will start to become bigger than the configured 10 minutes. And if you zoom in very close your graph will be very low resolution because the lower limit is 10 minutes.

Upvotes: 0

Related Questions