Displaying the total count of a Metric, independent from the timeframe selected

Hi,

I use Grafana together with Graphite. In Grafana, I want to display the total count of METRIC_1 in a certain timeframe (more specifically, the last 24 hours). For example, assume that METRIC_1 is zero in the last 24 hours. Then, if I add 100 to METRIC_1, I want to display 100 in the last 5 minutes, 15 minutes, 1 hour and 24 hours. When using a simplestat in Grafana, although it shows me 100 in the past 5 minutes and the past 15 minutes, it shows 26 and 11 regarding the last 1hour and last 24hours respectivvely.

How can I make sure that, independent from the timeframe selected, the total count displayed equals 100?

if you want accurate totals in singlestat, make sure you add graphite function consolidateBy(sum) and set data points to 1 or set singlestat stat value to Total

Thank you Torkel. The consolidateBy(sum) function solved my problem.

Hi @torkel I have similar query but I am using prometheus with grafana . Can you please tell me how can I get the total count of metric independent from timeframe. I have tried using sum and sum_over_time but didn’t get any resolution. Please suggest

1 Like