Skip to content

Commit

Permalink
Support absolute dashboard URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDog committed Sep 19, 2023
1 parent 75f55c2 commit 3bb8b26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/templates/alertmanager/notification-template.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "__alertmanager" }}Alertmanager{{ end }}
{{ define "__alertmanagerurl" }}{{ .ExternalURL }}/#/alerts?receiver={{ .Receiver }}&silenced=false&inhibited=false&active=true&filter=%7Balertname%3D%22{{ .CommonLabels.alertname }}%22%7D{{ end }}
{{ define "__dashboardurl" -}}[[ .GrafanaAddress ]]/d/{{ (index .Alerts 0).Annotations.dashboard }}{{- end }}
{{ define "__dashboardurl" -}}{{ if hasPrefix "https://" (index .Alerts 0).Annotations.dashboard }}{{ (index .Alerts 0).Annotations.dashboard }}{{ else }}[[ .GrafanaAddress ]]/d/{{ (index .Alerts 0).Annotations.dashboard }}{{ end }}{{- end }}
{{ define "__runbookurl" -}}https://intranet.giantswarm.io/docs/support-and-ops/ops-recipes/{{ (index .Alerts 0).Annotations.opsrecipe }}{{- end }}

{{ define "slack.default.title" }}{{ .Status | toUpper }}[{{ if eq .Status "firing" }}{{ .Alerts.Firing | len }}{{- else }}{{ .Alerts.Resolved | len }}{{- end }}] {{ (index .Alerts 0).Labels.alertname }} - Team {{ (index .Alerts 0).Labels.team }}{{ end }}
Expand Down

0 comments on commit 3bb8b26

Please sign in to comment.