Kimble
Kimble

Reputation: 7574

Plotting a Prometheus counter as number of events in Grafana

Say I have a counter counting some errors. The application with the counter can run multiple instances. My understanding is that something like this will give me a graph with errors per second per instance of the application.

rate(lookup_errors_total[5m])

I find that errors per second makes is it mentally challenging to interpret the graph (perhaps thats just me). Is there any way to plot this as a bar chart in Grafana where each bar represents a number of errors?

Upvotes: 2

Views: 3618

Answers (1)

Jens Baitinger
Jens Baitinger

Reputation: 2365

use the following query:

sum(increase(lookup_errors_total[$__range]))

increase will calculate the absolute increase of events counted (and not calculating down the number of events per second) sum will sum up multimple timelines, so you have a single timeline in the end

$__range will be the length of your selected timeline in grafana (e.g. if you selected one day, it will be 24h (or and equivalent value like 1d or 1440m)

Upvotes: 2

Related Questions