Files
kubernetes/victoria-metrics/alertmanager-ntfy.config.yml
Dustin C. Hatch d5bfdaca25 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.
2024-05-22 15:20:27 -05:00

28 lines
806 B
YAML

http:
addr: :8000
ntfy:
baseurl: http://ntfy.ntfy:2586
notification:
topic: alerts
priority: |
status == "firing" ? "urgent" : "default"
tags:
- tag: heavy_check_mark
condition: status == "resolved"
- tag: rotating_light
condition: status == "firing"
templates:
title: >-
{{ if eq .Status "resolved" }}Resolved: {{ end -}}
{{ if index .Annotations "summary" -}}
{{ index .Annotations "summary" }}
{{ 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" }}