How to map numbers to values or go syntax as part of description in alert rules

6 views
Skip to first unread message

Rajesh Reddy Nachireddi

unread,
May 17, 2020, 5:30:14 AM5/17/20
to Prometheus Users
Hi,

we have defined alert definition with multiple thresholds but we want to single message based on severity

Below are the mapping we have based on the value to represent them in a message while formatting

1 == UNREACHABLE
2 == AUTHFAILED
3 == TIMEOUT
4 == TRANSITERROR


so, we want to change the description in rule annotations based on the value to corresponding status.. How to write the if, else conditions.

annotations:
    description:  Device Diagnostics failed with {{if 1 then UNREACHABLE elif 2 then AUTHFAILED }}

Regards,

Rajesh
Reply all
Reply to author
Forward
0 new messages