The Prometheus monitoring feature allows you to add metric trend charts to the alert cards of a DingTalk group. You can obtain more information about alerts from metric trend charts, which helps troubleshoot problems. This topic describes how to configure Prometheus alert policies to add metric trend charts to alert cards.
Prerequisites
- A DingTalk group is created. For more information, see DingTalk chatbots.
- A notification policy is defined where the DingTalk group is specified as the alert contact. For more information, see Create and manage a notification policy.
Configure a metric trend chart
- Log on to the ARMS console.
- In the left-side navigation pane, choose .
- On the Prometheus Alert Rules page, perform one of the following operations based on your needs:
- To configure a metric trend chart for an existing alert, find the alert and click Edit next to the alert.
- To configure a metric trend chart for a new alert, click Create Prometheus Alert Rule.
- On the Edit Prometheus Alert Rules or Create Prometheus Alert Rule page, perform one
of the following operations based on your needs:
View the metric trend chart
After the configuration is complete and an alert is triggered, you can view the metric trend chart in the alert card for the DingTalk group.
For more information about alert cards, see Manage alerts in a DingTalk group.
FAQ
- Why do I still need to manually configure the alert PromQL statement even if I do
not use the statement?
The alert PromQL statement is not exactly the same as the PromQL statement to display the metric trend chart in terms of threshold judgment and the AND/OR logic. You must remove the threshold judgment from the alert PromQL statement.
- Why is the metric trend chart not displayed after the _aliyun_display_promql is specified?
Only when the _aliyun_display_promql parameter and the time series obtained by using the PromQL statement have the exact same label, the metric trend chart can be rendered. Typically, multiple time series can be obtained after you execute a PromQL statement. A time series is selected based on the label to render the metric trend chart. For example, if the metric obtained by executing the
cpu_usage > 80
statement contains the pod_name and container labels, the query result by using the _aliyun_display_promql parameter must also contain the labels.