I am trying to template a grafana alert:
{{ define "template" }}
host {{ .Labels.alertname }} has been caused by {{ .Labels.host }}
{{ .Annotations.Summary }}
{{ end }}
But the alert is only sent up to the first label
This is the error log:
logger=alerting.notifier.slack level=error msg="Missing receiver"
logger=alerting.notifier.slack level=error msg="Missing group labels"
logger=alerting.notifier.slack lvl=warn msg="failed to template Slack message" err="template: template:3:15: executing \"template\" at <.Labels.alertname>: can't evaluate field Labels in type *channels.ExtendedData"
If I remove the template, the alert works fine
Any ideas what could cause this?
Thanks