From cb2a4b38a4f971a80b80b196d2c969d1f1883065 Mon Sep 17 00:00:00 2001 From: Theo Brigitte Date: Mon, 6 Jan 2025 11:22:25 +0100 Subject: [PATCH] add comments in url-template --- .../alertmanager/url-template.tmpl.helm-template | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/helm/observability-operator/files/alertmanager/url-template.tmpl.helm-template b/helm/observability-operator/files/alertmanager/url-template.tmpl.helm-template index 21efcd27..6d2c3775 100644 --- a/helm/observability-operator/files/alertmanager/url-template.tmpl.helm-template +++ b/helm/observability-operator/files/alertmanager/url-template.tmpl.helm-template @@ -1,6 +1,12 @@ {{` +{{/* + __alerturl is the link pointing to a page in Grafana with details and source expressiong of the alert. +/*}} {{ define "__alerturl" }}`}}{{ .Values.alerting.grafanaAddress }}{{`/alerting/Mimir/{{ .CommonLabels.alertname }}/find{{ end }} +{{/* + __dashboardurl is the link pointing the Grafana dashboard referenced in the alert annotation if any. +/*}} {{ define "__dashboardurl" -}} {{- if match "^https://.+" (index .Alerts 0).Annotations.dashboard }}{{ (index .Alerts 0).Annotations.dashboard -}} {{- else -}} @@ -8,9 +14,17 @@ {{- end -}} {{- end }} +{{/* + __queryurl is the link pointing to Grafana explore with the alert expression prefilled. + + grafanaExploreURL is a Mimir Alertmanager specific template function: https://grafana.com/docs/mimir/latest/references/architecture/components/alertmanager/#templating, its second argument is the datasource id +/*}} {{ define "__queryurl" -}} {{- grafanaExploreURL "`}}{{ .Values.alerting.grafanaAddress }}{{`" "ce76fwwsnhipsa" "now-1h" "now" (queryFromGeneratorURL (index .Alerts 0).GeneratorURL) -}} {{- end }} +{{/* + __runbookurl is a link to the intranet's opsrecipe referenced in the alert annotation. +*/}} {{ define "__runbookurl" -}}https://intranet.giantswarm.io/docs/support-and-ops/ops-recipes/{{ (index .Alerts 0).Annotations.opsrecipe }}{{- end }} `}}