I have prometheus configured with grafana for application monitoring. I have a counter configured in my code, and prometheus query works well to fetch the metrics. I have a query like this to find the count increase per 10m :
sum(increase(countmetrics[10m]))
I want to display the result of this query in grafana. So if I select a 5 hours time line, I expect 30 values to be displayed(5*6). I am not sure which display option I should go for. Graph is not a good fit here, it seems. Would gauges be a good option or stats?
Do you want to see all 30 values? Table might be good.
Do you want to see how the values change over time? Graph
Do you only care about the current value? Stat or gauge
I tried table with time window of 5 mins and time range selected as 30 mins in top right corner. So I expected 6 datapoints, with each datapoint representing a 5 min slot on time line and corresponding inxrease in the counter value. But I see huge number of datapoints, like this:
Note that query results will be shifted by 10 minutes in the future, e.g. the time bucket from 00:10 to 00:20 will show the countmetrics increase from 00:00 to 00:10. This can be fixed by using negative offset, which has been enabled by default in Prometheus 2.33.0: