prometheus: cleanup bird alerts

This commit is contained in:
jeltz 2023-11-03 20:52:12 +01:00
parent c4744e9ab6
commit 3864b641eb
Signed by: jeltz
GPG key ID: 800882B66C0C3326

View file

@ -5,17 +5,21 @@ prometheus__scraping_bird:
port: 9324
prometheus__rules_bird:
- record: bird:protocol_up:bgp
- record: bird:protocol_up:bgp_all
expr:
label_replace(
bird_protocol_up{proto="BGP",}
unless bird_protocol_up{
proto="BGP",
name=~"^(viarezo|isp[12]|rezel)[46]$"
},
bird_protocol_up{proto="BGP"},
"group", "$1",
"instance", "^([^0-9\\.]+)-[0-9]+.*"
)
# FIXME: sessions en cours d'installation, pas encore monitorées
- record: bird:protocol_up:bgp
expr:
bird:protocol_up:bgp_all
unless bird:protocol_up:bgp_all{
group="edge",
name=~"^(viarezo|isp[12]|rezel)[46]$"
}
# Sessions qui ne sont volontairement pas redondées
# au sein d'un groupe
- record: bird:protocol_up:bgp:non_redundant
@ -35,10 +39,10 @@ prometheus__rules_bird:
(
count by (group, name) (
bird:protocol_up:bgp:redundant{state="Established"}
) or (
) + (
count by (group, name) (
bird:protocol_up:bgp:redundant{state!="Established"}
) * 0
bird:protocol_up:bgp:redundant{state!="Established"} * 0
)
)
) < 2
for: 0m
@ -53,10 +57,10 @@ prometheus__rules_bird:
(
count by (group, name) (
bird:protocol_up:bgp{state="Established"}
) or (
) + (
count by (group, name) (
bird:protocol_up:bgp{state!="Established"}
) * 0
bird:protocol_up:bgp{state!="Established"} * 0
)
)
) == 0
for: 0m
@ -65,6 +69,7 @@ prometheus__rules_bird:
annotations:
Session: !unsafe "{{ $labels.name }}"
Group: !unsafe "{{ $labels.group }}"
# TODO: warning pour redondant ?
- alert: BirdBGPNoExportedPrefixRedundant
expr:
bird_protocol_prefix_export_count{