Can Prometheus support label-based alarm priority capabilities?
Proposal
Use case. Why is this important? If you have lots job to monitor. You can set a general alarm rule like:
- alert: HighCPU
expr: cpu_usage > 50
for: 5m
annotations:
summary: High CPU
but there is a job that needs special treatment, so you can add a new alert rule
- alert: HighCPU
expr: cpu_usage > 50
for: 5m
annotations:
summary: High CPU
- alert: HighCPU For job1
expr: cpu_usage{job="job1"} > 80
for: 5m
annotations:
summary: High CPU
if the cpu_usage of job1 is 60, the first alert rule "HighCPU" will still triggered.
Of course you can avoid it by modifying the "HighCPU" rule:
- alert: HighCPU
expr: cpu_usage{job!="job1"} > 50
for: 5m
annotations:
summary: High CPU
- alert: HighCPU For job1
expr: cpu_usage{job="job1"} > 80
for: 5m
annotations:
summary: High CPU
But what if there are more jobs that need special treatment? And If you remove the specially treated job, you also need to delete the blocking rule in the general rule.
Can Prometheus support label-based alarm priority capabilities?
For cpu_usage > 50 and cpu_usage{job="job1"} > 80, cpu_usage{job="job1"} has a higher alarm priority,
For cpu_usage{job="job1"} > 80 and cpu_usage{job="job1", service="mysql"} > 85, cpu_usage{job="job1", service="mysql"} > 85 has a higer alarm priority.
Label-Value pairs Must be a subset relationship.
See https://www.robustperception.io/using-time-series-as-alert-thresholds
I'm closing it for now. If you have further questions, please use our user mailing list, which you can also search.