Did you try {{ .CommonAnnotations.dashboardId }} ?
Thanks for these. My company recently upgraded their Grafana instance and the new alerting system and most of the UI is driving me absolutely insane. It’s so, so, so, much more complicated than it used to be and I’m losing my gd mind.
thanks for the great example! i am having hard time with showing the <a href>-s in telegram, it is not showing the links, it simply shows text:
<a href="{{ .DashboardURL}}"> DashboardURL</a>
but if i am putting
<a href="https://example.com"> DashboardURL</a>
it works perfectly. or if i put
{{ .DashboardURL}}
it also correctly shows the DashboardURL value
for whatever reason the href and {{ .DashboardURL}} are not working together
i am running grafana:latest (the 10 version) and my parse mode is set to HTML. everything is working fine, just the href + Dashboard or any other variables are not working ![]()
will appreciate if someone can show me directions what i may be doing wrong
Just tested, I got the same error.
This seems a lot like a bug, the variable should be rendered correctly, I would suggest to post an issue on GitHub - grafana/grafana: The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more..
Hi, everyone!
Hello, everyone
I have implemented this template in various Grafana instances with versions above 9.3.2.
But recently, I tried to set it up in a Grafana v11 instance and it didn’t work.

The test message sends normally, but when I attach it to an alert, I receive a 400 webhook error.

I have already set the parse mode to HTML as suggested in another part of this thread, but I am still having issues. Is anyone else experiencing the same problem with this latest version?
from grafana logs:
logger=ngalert.notifier.alertmanager org=1 t=2024-06-19T18:14:23.919197155Z level=error component=alertmanager orgID=1 component=dispatcher msg="Notify for alerts failed" num_alerts=5 err="telegram_alert/telegram[0]: notify retry canceled due to unrecoverable error after 1 attempts: failed to send telegram message: webhook response status 400 Bad Request"
Hi Everyone,
I am using the below slack template to get the Slack message in easily readable form, I think this template will help someone, I put a lot of effort into achieving it.
My Grafana Version : 11.0.0
I am using alerting grafana alerting data source, not alert manager.
while doing the configuration of the Slack contact point, add the below code or update if you already have Slack webhook config. under “Optional Slack settings” as mentioned in the snapshot
Title: {{ template "slack_title" . }}
Text body: {{ template "slack_message" . }}
your template name should be “slack” and just copy paste the below template
{{ define "slack_title" }}
{{ if gt (len .Alerts.Firing) 0 }}
🔥 {{ len .Alerts.Firing }} alert(s) firing
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
✅ {{ len .Alerts.Resolved }} alert(s) resolved
{{ end }}
{{ end }}
{{ define "__text_values_list" }}{{ if len .Values }}{{ $first := true }}{{ range $refID, $value := .Values -}}
{{ if $first }}{{ $first = false }}{{ else }}, {{ end }}{{ $refID }}={{ $value }}{{ end -}}
{{ else }}[no value]{{ end }}{{ end }}
{{ define "slack_message" }}
{{ if gt (len .Alerts.Firing) 0 }}
{{ range .Alerts.Firing }} {{ template "slack_alert_firing" .}} {{ end }} {{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
{{ range .Alerts.Resolved }} {{ template "slack_alert_resolved" .}} {{ end }} {{ end }}
{{ end }}
{{ define "slack_alert_firing" }}
*Summary:* {{ .Annotations.summary }}
*Value:* {{ template "__text_values_list" . }}
*Labels:* {{ .Labels }}
*Panel URL:* {{ .PanelURL }}
{{ end }}
{{ define "slack_alert_resolved" }}
*Alert Resolved:* {{ .Labels.alertname }}
The alert has been resolved.
{{ end }}
Finally, your slack message will looks like as below snapshot
If state is firing:
If state is resolved:
Note: If you need to get the printed name of your instances/metrics under labels then use the alert rule condition as below, as it’s not working for me if I am using alert condition for "classic condition (legacy)
- A = query
- B = Reduce last of A
- C = Threshold of B - set as Alert condition


