Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: granafa监控通过企业微信报警,告警有 Template variables are not supported in alert queries
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 5.4.3
[Encountered Problem: Problem Phenomenon and Impact]
When configuring WeChat Work alerts on Grafana, I found a warning: “Template variables are not supported in alert queries.” I couldn’t find relevant information in the official documentation. How should I configure this?
In Grafana, if a series in a chart uses template variables, when setting an alert, if you select this series with template variables, the aforementioned prompt will appear. Try creating a new chart without variables and then configure the alert.
Also, why not use Prometheus’s Alertmanager for alerts?
Isn’t this for convenience? Granafa+PrometheusAlert for host monitoring can be set up in a few minutes. Who knew there would be so much to adjust for TiDB’s Granafa?
Take a look at your tmpl file in the template, is there something like
Alert Level: {{ .Labels.severity }}
written there?
TiDB defines the alert level label as level, so this needs to be changed to
Alert Level: {{ .Labels.level }}
I vaguely remember being tripped up by this once before. 
Professional, it should be like this.
How can Alertmanager send alert notifications to a WeChat Work group?
I’ll write a document for you once I get the debugging done.
Prometheus, Alertmanager, and PrometheusAlert have been successfully configured. Alerts can be sent to the enterprise WeChat group via webhook.
Integrate with prometheus-webhook
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.