We're using two groups of Alerts
- common for all teams
- per-team only
In prometheus config it looks like this:
rule_files:
- /git-sync/common/*.yaml
- /git-sync/rules/*.yaml
And directory git-sync comes from team repo. In this repo folder /common/ comes from git submodule.
This mostly works fine, but there are corner cases when team want to override some common Alert rule on their level.
Currently it is not possible, consider this case:
# /git-sync/common/prom.yaml
groups:
- name: prom
rules:
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
severity: critical
annotations:
summary: Instance scrape failed
# /git-sync/rules/prom.yaml
groups:
- name: prom
rules:
- alert: InstanceDown
expr: up{group!="maintenance"} == 0
for: 5m
labels:
severity: critical
annotations:
summary: Instance scrape failed
This still loads as 2 different alerts in Prometheus, and first one continues to fire.
Is it possible to override alerts?
Shouldn't alert names be unique?