Alert notification templating not working

Hello,

I want to use variables in an alert notification as described in Alert notification templating | Grafana Labs.
I tested several variable syntax formats and nothing of this is working.

I send the notification to a webhook with the message ${var} and see this text in the send query. The variable is not templated. I tested it with a Text Box Variable and a constant and both are not working. Actually I want to send server names to my webhook, but however constant variables are not working.

What am I am doing wrong? Is there actually a bug?

Best Regards
Max

2 Likes

I checked myself too but seems like NOTHING IS WORKING

webhook request gave me all as it is .

    192.168.01.50 - - [23/Feb/2021 07:55:01] "POST /webhook HTTP/1.1" 200 -
ERROR:root:POST request,
Path: /webhook
Headers:
Host: 192.168.01.105:8089
User-Agent: Grafana
Content-Length: 431
Content-Type: application/json
Accept-Encoding: gzip


Body:
{"dashboardId":24,"evalMatches":[],"message":"error di 01\n{ \"pod\": ${pod}, \"container\": \"${container}\", \"job\": \"${job}\" }","orgId":1,"panelId":3,"ruleId":2,"ruleName":"${pod} ${job}","ruleUrl":"https://localhost/di-dashboard?tab=alert\u0026viewPanel=3\u0026orgId=1","state":"no_data","tags":{"container":"${container}","server-down":"true"},"title":"[No Data] ${pod} ${job}"}

192.168.01.50 - - [23/Feb/2021 08:01:01] "POST /webhook HTTP/1.1" 200 -
2 Likes

Hi guys,
Any updates on this?

1 Like

I face a similar problem.

I use an influx query where I successfully use the value of a tag in the Alias.
grafik
But when I try to use the same value inside the alert message no variant of the template syntax I tried works.
grafik

I know that one of these syntaxes used to work in the past in a dashboard I removed. This question occurs quite often but never with an answer is really frustrating. I’m aware that this kind of alerting is considered “legacy” but still it should be usable as we cannot all migrate immediately.

I’m having this same issue with v7.5.11. Templating is just not working

This topic was automatically closed after 365 days. New replies are no longer allowed.