This topic describes how to create an alert rule for application monitoring and manage alert notifications.
Prerequisites
Your application is monitored by Application Real-Time Monitoring Service (ARMS). For more information, see Application Monitoring overview.
Background information
ARMS application monitoring and alerting allows you to configure alert rules for various collected application metrics. You can create alert rules based on your needs and business scenarios. This way, you can receive alert notifications and take necessary actions when your applications do not work as expected. This topic describes how to use ARMS application monitoring alert rules in the following sample scenario:
Sample scenario: The response time of requests to the core business is long, or the request success rate is decreased.
Sample application: user-service: The user-service application is a Java application deployed in a Container Service for Kubernetes (ACK) cluster and has been connected to ARMS.
The user-service application runs the core services of an enterprise. The availability of the API operations provided by the application must be ensured. Otherwise, the core business may be affected. If the response time of API requests to the services run by the application is increased, or the request success rate is decreased, O&M engineers must take necessary actions at the earliest opportunity to avoid business loss. Therefore, alert notifications must be sent to O&M engineers.
In this scenario, O&M engineers need to pay attention to 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 connected to the application monitoring feature
To verify whether the user-service application is connected to the application monitoring feature, perform the following operations:
Log on to the ARMS console.
In the left-side navigation pane, choose .
On the Applications page, click the user-service application.
On the page that appears, click Application Overview in the left-side navigation pane.
On the Application Overview page, check whether data is displayed.
In the left-side navigation pane, click Application Details.
On the Overview tab of the page that appears, check whether metrics data is displayed.
If the monitoring data is displayed on the Application Overview page, the user-service application is connected to the application monitoring feature of ARMS. If no data is displayed on the Application Overview page, the connection fails. In this case, connect the application to the application monitoring feature again.
NoteThe sample application is a Java application deployed in an ACK cluster. The information displayed on the Application Overview page varies with the application type.
Step 2: Go to the Create Application Monitoring Alert Rule page
Method 1
Log on to the ARMS console.
In the left-side navigation pane, choose .
In the top navigation bar, select a region.
On the Applications page, click the user-service application.
In the Application Support Services section of the Application Overview page, click the Create an alert icon in the upper-right corner of a trend chart to go to the Create Application Monitoring Alert Rule page.
If you go to the Create Application Monitoring Alert Rule page by clicking the Create an alert icon, the system automatically sets the Select Applications and Metric Type parameters.
Method 2
Log on to the ARMS console.
In the left-side navigation pane, choose .
In the top navigation bar, select a region.
In the upper-right corner of the Application Monitoring Alert Rule page, click Create Application Monitoring Alert Rule.
On the Create Application Monitoring Alert Rule page, set the Select Applications parameter to user-service and the Metric Type parameter to Invocation_Type.
Step 3: Create an alert rule for application monitoring
In this sample, you need to create the following two alert rules. When you create the alert rules, specify that alert notifications are sent to contacts by using text messages, emails, and DingTalk group messages when alerts are triggered.
An alert rule that is used to monitor the request response time for the user-service application.
Send an alert notification if the response time of application dependent service calls is longer than or equal to 500 ms in the last 3 minutes.
An alert rule that is used to monitor the request success rate for the user-service application.
Send an alert notification if the success rate of application dependent service calls is lower than or equal to 90% in the last 3 minutes.
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 the response time or success rate of API requests has not been as expected for a long period of time, you must check the API operations provided by your application. To identify exceptions at the earliest opportunity, you can specify that an alert notification is sent when the average response time is longer than or equal to 500 ms or the request success rate is lower than or equal to 90% in the last 3 minutes. When you create alert rules for application monitoring, you can specify different conditions based on your needs.
On the Create Application Monitoring Alert Rule page, enter a name for the alert rule and specify the conditions that trigger an alert.
In this sample, create an alert rule that is used to monitor the request response time for the user-service application.
Specify a notification policy for the alert rule.
If you have created a notification policy, select the 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 and select the notification policy from the drop-down list.
(Optional) Click Quickly create notification policies next to the Notification Policy drop-down list.
In the Quickly create notification policies panel that appears, select the Notification object and set the other parameters. Then, click Confirm.
If you have created a notification object, select the notification object in the Notification object section.
If no notification object is available, perform Step 4 to create a notification object. After a notification object is created, click the Refresh icon in the upper-right corner of the Quickly create notification policies panel and select the notification object.
(Optional) Click create a notification object next to Notification object, and then click Create a notification object below the drop-down list.
On the Notifications Objects page that appears, you can create notification objects including contacts, DingTalk, Lark, and WeCom.
On the Contacts tab, click Create Contact.
In the Create Contact dialog box, set the parameters as required and click OK.
On the Contacts tab, click Create Contact Group.
In the Create Contact Group dialog box, set the Group name parameter, add the contact that you create in the preceding step to the contact group, and then click OK.
On the DingTalk /Lark/WeCom tab, click DingTalk.
In the Create DingTalk Chatbot panel that appears, set the parameters and click OK.
After the alert rule is configured, click Save.
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
page.
Manage alerts
After you receive alert notifications, you can view the alert notification records and the time when an alert notification was sent in the console.
Log on to the ARMS console.
Go to the details page of the application that you want to manage. In the left-side navigation pane, choose .
The Alarm page appears. On this page, you can view the alert notification records and the time when an alert notification was sent. For more information, see View alert notification records.