I have Grafana 9.5.7 version, which was set up by Hilm chart. I also have alerting rules, policies and contact points. When I tying to put my template into file, It seems like Grafana is ignoring it.
alerting:
rules.yaml:
apiVersion: 1
templates:
- orgId: 1
name: slack
template: |
`{{ define "slack.print_alert" -}}
[{{.Status}}] {{ .Labels.alertname }}
Labels:
{{ range .Labels.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ if .Annotations -}}
Annotations:
{{ range .Annotations.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ end -}}
{{ if .SilenceURL -}}
Silence: {{ .SilenceURL }}
{{ end -}}
{{ if .DashboardURL -}}
Go to dashboard: {{ .DashboardURL }}
{{- end }}
{{- end }}`
groups:
- orgId: 1
name: cpu-seed-sale
folder: creafans
interval: 1m
rules: {}
On grafana dashboard I see only name of template without code. Why? What is wrong with it?