1
0
Fork 0

v-m/alertmanager-ntfy: Add labels to notifications

Just having the alert name and group name in the ntfy notification is
not enough to really indicate what the problem is, as some alerts can
generate notifications for many reasons.  In the email notifications
AlertManager sends by default, the values (but not the keys) of all
labels are included in the subject, so we will reproduce that here.
etcd
Dustin 2024-05-22 15:20:27 -05:00
parent aedd4df9f6
commit d5bfdaca25
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ ntfy:
{{ else -}}
{{ index .Labels "alertname" }}
{{ index .Labels "alertgroup" }}
{{ range $key, $value := .Labels -}}
{{ if not (eq $key "alertname" "alertgroup") }}{{ $value }} {{ end -}}
{{ end -}}
{{ end -}}
description: |
{{ index .Annotations "description" }}