generated from giantswarm/template-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a5e321
commit cb2a4b3
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
helm/observability-operator/files/alertmanager/url-template.tmpl.helm-template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
{{` | ||
{{/* | ||
__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 -}} | ||
`}}{{ .Values.alerting.grafanaAddress }}{{`/d/{{ (index .Alerts 0).Annotations.dashboard -}} | ||
{{- 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 }} | ||
`}} |