You can create an alert rule in Grafana 10.0.x and push the rule to the Alert Management sub-service of Application Real-Time Monitoring Service (ARMS). This way, you can automatically detect exceptions for custom metrics and handle the exceptions in the ARMS console. In addition, you can specify a notification policy and push alert cards to a DingTalk group. An alert card indicates the details about an alert, including its severity.
Create an alert rule in Grafana
Grafana 10.0.x is integrated into ARMS by default. To view details about the Grafana 10.0.x integration, log on to the ARMS console. In the left-side navigation pane, choose . On the Alert Integrations tab of the Integrations page, view the details.

Create an alert rule in Grafana
Log on to the ARMS console. In the left-side navigation pane, choose .
On the Workspace Management page, find the workspace that you want to manage and click the URL in the URL column to go to Grafana.
NoteYou can log on to Grafana with the administrator account of Grafana and the password that you configured when you created the workspace. You can also click Sign in with Alibaba Cloud to log on to Grafana with the current Alibaba Cloud account.
In the left-side navigation pane, choose or .
On the ITSM page, click Alert rules.
On the Alert rules page, click Create alert rule.
On the Add rule page, configure an alert rule and click Save rule.

Step 2: View alert information and notifications
Log on to the ARMS console.
- In the left-side navigation pane of the ARMS console, choose .
On the Events page, view the events.

Find an event and click Create Notification Policy to create a notification policy. Then, in the left-side navigation pane, choose , and you can view alert information.
After the configuration takes effect, an alert card is pushed to the specified DingTalk group.
The alert card displays details about the alert, including labels and annotations.
Optimize the alert rule
Configure the alert rule
In the Add details for your alert rule section of the Add rule page, add an annotation named
message.
The
messageannotation contains the values of event content specified in Alert Management. You can add the values in the query results of an alert rule and the labels in PromQL query results to an annotation. For information about templates, see Templating labels and annotations.The following table describes the variable values added to the
messageannotation. You can also add other labels that exist in the alert rule.Variable value
Description
deploymentin{{ $labels.deployment }}View the value in the Set a query and alert condition section of the Add page.

valuein{{ index $values "B" }}View the value in the Set a query and alert condition section of the Add page.

After the configuration takes effect, an alert card is pushed to the specified DingTalk group.
Configure the severity
In the Notifications section of the Add rule page, set the
severityas a label. Use theseverityspecified in Alert Management.
The following table describes the mapping relationships between the severity values of Grafana and severity levels of Alert Management.
Severity value
Severity level
criticalP1
errorP2
warningP3
pageP4
After the configuration takes effect, an alert card is pushed to the specified DingTalk group.