diff --git a/helm/observability-operator/files/alertmanager/notification-template.tmpl b/helm/observability-operator/files/alertmanager/notification-template.tmpl index 47bda93a..ceaefe29 100644 --- a/helm/observability-operator/files/alertmanager/notification-template.tmpl +++ b/helm/observability-operator/files/alertmanager/notification-template.tmpl @@ -35,7 +35,7 @@ 📈 Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch. {{ end -}} 👀 Explore: {{ template "__queryurl" . }} -🔔 Silence: https://github.com/giantswarm/silences#silences +🔔 Silence: {{ template "__alert_silence_link" . }} --- @@ -45,17 +45,9 @@ 🔥 {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }} {{- end }} -# This builds the silence URL. We exclude the alertname in the range -# to avoid the issue of having trailing comma separator (%2C) at the end -# of the generated URL +# Link to the silence repository where silences should be created {{ define "__alert_silence_link" -}} - {{ .ExternalURL }}/#/silences/new?filter=%7B - {{- range .CommonLabels.SortedPairs -}} - {{- if ne .Name "alertname" -}} - {{- .Name }}%3D"{{- .Value -}}"%2C%20 - {{- end -}} - {{- end -}} - alertname%3D"{{ .CommonLabels.alertname }}"%7D +https://github.com/giantswarm/silences#silences {{- end }} # Link to related PMs