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.
This commit is contained in:
@@ -19,6 +19,9 @@ ntfy:
|
|||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{ index .Labels "alertname" }}
|
{{ index .Labels "alertname" }}
|
||||||
{{ index .Labels "alertgroup" }}
|
{{ index .Labels "alertgroup" }}
|
||||||
|
{{ range $key, $value := .Labels -}}
|
||||||
|
{{ if not (eq $key "alertname" "alertgroup") }}{{ $value }} {{ end -}}
|
||||||
|
{{ end -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
description: |
|
description: |
|
||||||
{{ index .Annotations "description" }}
|
{{ index .Annotations "description" }}
|
||||||
|
|||||||
Reference in New Issue
Block a user