All Products
Search
Document Center

Application Real-Time Monitoring Service:Create an alert rule in Grafana 10.0.x and push it to Alert Management

Last Updated:May 17, 2024

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 Alert Management > Integrations. On the Alert Integrations tab of the Integrations page, view the details.

image.png

Create an alert rule in Grafana

  1. Log on to the ARMS console. In the left-side navigation pane, choose Managed Service for Grafana > Workspace Management.

  2. 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.

    Note

    You 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.

  3. In the left-side navigation pane, choose Applications > ITSM or Apps > ITSM.

  4. On the ITSM page, click Alert rules.

  5. On the Alert rules page, click Create alert rule.

  6. On the Add rule page, configure an alert rule and click Save rule.

    image.png

Step 2: View alert information and notifications

  1. Log on to the ARMS console.

  2. In the left-side navigation pane of the ARMS console, choose Alert Management > Alert Event History.
  3. On the Events page, view the events.

    image.png

  4. Find an event and click Create Notification Policy to create a notification policy. Then, in the left-side navigation pane, choose Alert Management > Alert Sending History, and you can view alert information.

  5. 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

  1. In the Add details for your alert rule section of the Add rule page, add an annotation named message.

    image.png

    • The message annotation 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 message annotation. You can also add other labels that exist in the alert rule.

      Variable value

      Description

      deployment in {{ $labels.deployment }}

      View the value in the Set a query and alert condition section of the Add page.

      image.png

      value in {{ index $values "B" }}

      View the value in the Set a query and alert condition section of the Add page.

      image.png

  2. After the configuration takes effect, an alert card is pushed to the specified DingTalk group.

Configure the severity

  1. In the Notifications section of the Add rule page, set the severity as a label. Use the severity specified in Alert Management.

    image.png

    The following table describes the mapping relationships between the severity values of Grafana and severity levels of Alert Management.

    Severity value

    Severity level

    critical

    P1

    error

    P2

    warning

    P3

    page

    P4

  2. After the configuration takes effect, an alert card is pushed to the specified DingTalk group.