Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use sum_over_time vs increase Promql Grafana

I am a little unclear on when to exactly use increase and when to use sum_over_time in order to calculate a periodic collection of data in Grafana. I want to calculate the total percentage of availability of my system. Thanks.

like image 439
pixelWorld Avatar asked Dec 07 '25 02:12

pixelWorld


1 Answers

The "increase" function calculates how much a counter increased in the specified interval.

The "sum_over_time" function calculates the sum of all values in the specified interval.

Suppose you have the following data series in the specified interval:

5, 5, 5, 5, 6, 6, 7, 8, 8, 8

Then you would get:

increase = 8-5 = 3
sum_over_time = 5+5+5+5+6+6+7+8+8+8 = 63

If your goal is to calculate the total percentage of availability I think it's better to use the "avg_over_time" function.

like image 65
Marcelo Ávila de Oliveira Avatar answered Dec 10 '25 14:12

Marcelo Ávila de Oliveira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!