Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prometheus query for sum of alerts sent out each hour

Hi I need to find the sum alerts sent out for past 24 hrs on an hourly count. Can Prometheus query gives this information directly in the console. I can use sum(alerts) and see the graph by selecting the timeframe.

But I need the amount of alerts sent out each hour in console so that I can copy that data to excel.

The sum_over_time query gives total data count for past 1d in console:

sum_over_time(alerts[1d])

Again there is no option to aggregate the total based on each hour.

like image 311
Dinesh KR Avatar asked Dec 08 '25 21:12

Dinesh KR


1 Answers

You might be looking for sum(increase(prometheus_notifications_sent_total[24h])).

It shows the increase of the prometheus_notifications_sent_total metric over the last 24h.

You might also want to deduct the number of dropped notifications from it sum(increase(prometheus_notifications_dropped_total[24h])).

like image 109
hagen1778 Avatar answered Dec 12 '25 01:12

hagen1778



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!