This topic describes how to create an alert rule for application monitoring and manage alert notifications.

Prerequisites

Your application is added to Application Real-Time Monitoring Service (ARMS) for monitoring. For more information, see Overview.

Background information

Enterprise Distributed Application Service (EDAS) allows you to configure alert rules for various metrics that are collected from monitored applications. You can create alert rules based on your business requirements and scenarios. This allows you to receive alert notifications when your applications do not work as expected and to take necessary actions at the earliest opportunity. This topic describes how to use alert rules for EDAS application monitoring.

The following scenario is used as an example in this topic: Requests to the core services have a long response time, or the success rate of requests decreases.

The user-service application is used in this example. user-service is a Java application deployed in a Container Service for Kubernetes (ACK) cluster and is monitored by EDAS.

The user-service application runs the core services of an enterprise. Its API operations must be highly available. When the response time of API requests increases, or the request success rate decreases, O&M engineers must be notified to take necessary actions as soon as possible.

In this scenario, O&M engineers need to observe the following metrics:
  • The average response time of API requests to the services that are run by the application
  • The success rate of API requests to the services that are run by the application

Step 1: Verify whether the application is monitored

To verify whether the user-service application is monitored, perform the following operations:

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. On the page that appears, find the user-service application and click the application name.
    1. On the page that appears, click Application Overview in the left-side navigation pane.
    2. On the Application Overview page, check whether data is displayed.

    If the data of the application is displayed on the page, the user-service application is monitored. If no data is displayed, the application is not monitored. In this case, enable application monitoring for the application.

    Note The sample application is a Java application deployed in an ACK cluster. The information displayed on the page varies with the application type.

Step 2: Go to the Create Application Monitoring Alert Rule page

  1. Log on to the EDAS console.
  2. In the top navigation bar of the MNS console, select the region where your cluster is deployed.
  3. On the Applications page, select EDAS Kubernetes Cluster or Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Then, click the name of the application for which you want to create an alert rule.
  4. In the left-side navigation pane, choose Alert Management > Alert Rules.
  5. On the Application Monitoring Alert Rule page, click Create Application Monitoring Alert Rule in the upper-right corner.
  6. On the Create Application Monitoring Alert Rule page, set the Alert Application parameter to user-service and the Metric Type parameter to Invocation_Type.

Step 3: Create an alert rule for application monitoring

In this example, two alert rules are created. When you create the alert rules, specify that alert notifications are sent to contacts by using text messages, emails, and DingTalk group messages.

  • An alert rule that is used to monitor the response time of requests to the user-service application
    An alert notification is sent if the response time of API requests to the services that are run by the application is equal to or longer than 500 ms in the last 3 minutes. 
  • An alert rule that is used to monitor the request success rate for the user-service application
    An alert notification is sent if the success rate of API requests to the services that are run by the application is equal to or lower than 90% in the last 3 minutes. 
Note The response time and success rate of API requests may fluctuate within a short period of time. If this is the case, your core business is not affected. However, if this situation persists, you must check the API operations provided by your application. When you configure an alert rule, you can specify a period of time during which an exception persists. For example, an alert notification is sent when the average response time remains long, or the request success rate is lower than 90% for 3 minutes. When you create alert rules for application monitoring, you can specify different conditions based on your needs.
  1. On the Create Application Monitoring Alert Rule page, enter an alert name and specify the conditions that trigger an alert.
    In this example, first create an alert rule that is used to monitor the request response time for the user-service application.
  2. Specify a notification policy for the alert rule.
    • If you have created notification policies, select a notification policy from the Notification Policy drop-down list.
    • If no notification policy is available, perform Step 3 to create a notification policy. After a notification policy is created, click the Refresh icon next to the Notification Policy drop-down list on the Create Application Monitoring Alert Rule page, and select the notification policy that you created from the drop-down list.
  3. Optional:Click Create Notification Policy next to the Notification Policy drop-down list.
    In the Create Notification Policy panel, set the parameters and click OK.
    • If you have created contacts, select contacts from the Contact drop-down list.
    • If no contact is available, follow the instructions in Step 4 to create contacts. After a contact is created, reopen the Create Notification Policy panel and select the contacts that you created from the Contact drop-down list.
    Create Notification Policy
  4. Optional:Click Create Contact next to the Contact drop-down list.
    On the Contact page that appears, you can create a contact or a contact group, or add a DingTalk group to receive alert notifications.
    1. On the Contact tab, click Create Contact in the upper-right corner.
    2. In the Create Contact dialog box, set the parameters and click OK.
    3. On the Contact Group tab, click Create Contact Group in the upper-right corner.
    4. In the Create Contact Group dialog box, specify a group name, add the contact that you created in the preceding step to the contact group, and then click OK.
      After you create the contact group, the contact group is displayed on the Contact Group tab. Contact
    5. On the IM robot tab, click Create a robot in the upper-right corner.
    6. In the Create a robot dialog box, set the parameters for the DingTalk group and click OK.
      After you add the DingTalk group to receive alert notifications, the DingTalk group is displayed on the IM robot tab. Create a robot
  5. After the alert rule is configured, click Save.
  6. Repeat the preceding steps to create an alert rule that is used to monitor the request success rate for the user-service application.
    To view the alert rules that you created, go to the Alert Management > Alert Rules page. Two alert rules

View alert notifications

When alert conditions are met, alert notifications are sent based on the specified notification methods. Alert notifications can be sent by using text messages, emails, and DingTalk group messages. Examples:

  • Text message:Alert notification sent by using a text message
  • Email:Alert notification sent by using an email
  • DingTalk group message:Alert notification sent by using a DingTalk group message

    After you receive alert notifications in a DingTalk group, you can view and handle the alerts in the DingTalk group. For more information, see Manage alerts in a DingTalk group.

Handle alerts

After you receive alert notifications, you can view all the alert notifications and the time each notification was sent on the Alerts page.

  1. Log on to the EDAS console.
  2. Go to the details page of the application that you want to manage. In the left-side navigation pane, choose Alert Management > Alert sending History.
    The Alerts page appears. On this page, you can view all alert notifications and the time each notification was sent. For more information, see View historical alerts. Alert sending History