Monitoring with Grafana alerts via WeChat Work: Alert contains "Template variables are not supported in alert queries"

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

| username: 像风一样的男子

[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?

| username: tidb菜鸟一只 | Original post link

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?

| username: 像风一样的男子 | Original post link

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?

| username: 有猫万事足 | Original post link

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. :joy:

| username: Fly-bird | Original post link

Professional, it should be like this.

| username: 像风一样的男子 | Original post link

How can Alertmanager send alert notifications to a WeChat Work group?

| username: Fly-bird | Original post link

I’ll write a document for you once I get the debugging done.

| username: 像风一样的男子 | Original post link

Prometheus, Alertmanager, and PrometheusAlert have been successfully configured. Alerts can be sent to the enterprise WeChat group via webhook.

| username: tidb菜鸟一只 | Original post link

Integrate with prometheus-webhook

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.