0

For example, I have 2 hosts, alert will be fired when CPU > 90%. I can open Prometheus UI & Alert Manager UI, and I see Alerts firing for the 2 hosts.

I use webhook as receiver, I want to get the alert count for CPU>90% to each hosts, how can I achieve it?

I consider if I can get the count value from somewhere, then I can append it into alert label, finally I can get the value from labels in webhook interface.

I have referred to Count alerts fired by prometheus, they use changes function, but it cannot cover if value doesn't change(let's say CPU keep 90%).

xiaodong
  • 1
  • 3

1 Answers1

0

As considered, I think Prometheus and Alert manager are not support this situation, because it's not make sense.

For an user, if he/she want to know how many alert was fired by an particular rule(let's say CPU > 90%) in last 1 hour, they will only focus on how many alerts were received, instead of how many alerts fired by Prometheus.

As we know, Alert Manger has "group_wait","repeat_interval" and "Inhibited" rules, there parameters will affect how many and how often alert send out by Alert Manager. Even if I could get alert times fired by Prometheus, but the number would be wrong to an user, as Alert Manger might "Inhibited" the alert.

xiaodong
  • 1
  • 3