This topic provides an example to describe how to create application monitoring alert
rules and process alert notifications.
Prerequisites
An Enterprise Distributed Application Service (EDAS) application is connected to Application
Real-Time Monitoring Service (ARMS). For more information, see
Overview.
Background information
EDAS application monitoring and alerting allows you to configure alert rules for various
collected application metrics. You can configure appropriate alert rules based on
your requirements and business scenarios. This way, you can receive alert notifications
when applications do not run as expected, and respond at the earliest opportunity.
This topic describes how to use EDAS application monitoring alert rules in the following sample scenario:
Sample scenario: The request latency of core business is excessively high or the request
success rate decreases.
Name of the 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 in EDAS.
The user-service application is the core business of the enterprise. The decrease in the interface
availability of the application leads to serious consequences. Therefore, when the
response time of API calls for the services that are provided by this application
increases or the success rate of API calls for the services that are provided by this
application decreases, O&M engineers must receive notifications at the earliest opportunity
and respond with high efficiency.
In this context, the O&M engineers need to pay attention to the following metrics:
- Average response time of API calls for the services that are provided by the application
- Success rate of API calls for the services that are provided by the application
Step 1: Check whether the application is connected to ARMS
Perform the following steps to check whether the user-service application is connected to ARMS.
- Log on to the EDAS console.
- In the left-side navigation pane, click Applications. On the Applications page, click the name of the user-service application.
- In the left-side navigation pane, click Application Overview.
On the Application Overview page, check whether metric data exists on the Application Overview page.
If metric data exists on the Application Overview page, the application is connected
to ARMS. If no metric data exists on the Application Overview page, the application
has not been connected to ARMS. In this case, reconnect the application to ARMS.
Note The sample application is a Java application in an ACK cluster. If your application
is of another type, the display of the Application Overview page after the application
is connected to ARMS may be different from that shown in the preceding figure. Provided
that metric data exists on the Application Overview page, the application is connected
to ARMS.
Step 2: Go to the Create Application Monitoring Alert Rule page
- Log on to the EDAS console.
- In the top navigation bar of the MNS console, select the region where your cluster
is deployed.
- 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 user-service application.
- In the left-side navigation pane, choose .
- On the Application Monitoring Alert Rule page, click Create Application Monitoring Alert Rule in the upper-right corner.
- On the Create Application Monitoring Alert Rule page, set the Alert application parameter to user-service and the Indicator Type parameter to Invocation_Type.
Step 3: Create alert rules
In this example, create the following two alert rules to send alert notifications
to contacts by using text messages, emails, and DingTalk chatbots when the alert rules
are triggered:
- Alert rule for excessively long response time of API calls for the services that are
provided by the user-service application
The response time of API calls for the services that are provided by the user-service application in the last 3 minutes is greater than or equal to 500 ms.
- Alert rule for the decrease in the success rate of API calls for the services that
are provided by the user-service application
The error rate of API calls for the services that are provided by the user-service application in the last 3 minutes is less than or equal to 90%.
Note Generally, metrics for the interface fluctuate in a short period of time. You need
to pay attention and respond only to continuous abnormalities. Therefore, when you
create the alert rule, you can configure that the alert rule is triggered only when
the average response time of API calls for the services that are provided by the application
in the last 3 minutes is long or the error rate of API calls for the services that
are provided by the application in the last 3 minutes is less than 90%. When you create
an application monitoring alert rule, you can specify different time and metric calculation
methods as needed.
- On the Create Application Monitoring Alert Rule page, enter an alert rule name and specify a trigger condition.
Create the alert rule for excessively long response time of API calls for the services
that are provided by the user-service application.
- Set a notification policy.
- If you have created a notification policy, select an existing notification policy
from the Notification policy drop-down list.
- If you have not created a notification policy, perform Step 3 to create a notification
policy. After you create the notification policy, click the Refresh icon next to the
Notification policy drop-down list and select the created notification policy from
the Notification policy drop-down list on the Create Application Monitoring Alert Rule page.
- Optional:Click Create a notification policy to the right of the Notification policy drop-down list.
In the
Create a notification policy panel, set the parameters, including the
contact parameter, and click
OK.
- If you have created a contact, select an existing contact from the contact drop-down list.
- If you have not created a contact, perform Step 4 to create a contact. After you create
the contact, refresh the page and select the created contact from the contact drop-down list in the Create a notification policy panel.
- Optional:Click New contact next to the contact drop-down list.
On the Contact page, create a contact, a contact group, and a DingTalk group.
- On the Contact tab, click Create a contact in the upper-right corner.
- In the Create a contact dialog box, set the parameters and click OK.
- On the Contact Group tab, click Create a contact group in the upper-right corner.
- In the Create a contact group dialog box, enter a group name, add the created contact to the contact group, and
then click OK.
After you create the contact group, you can view the created contact group on the
Contact Group tab.
- On the DingTalk Group tab, click New DingTalk Group in the upper-right corner.
- In the New DingTalk Group dialog box, set the parameters and click OK.
After you create the DingTalk group, you can view the created DingTalk group on the
DingTalk Group tab.
- After you create the alert rule, click Save.
- Repeat the preceding steps to create the alert rule for the decrease in the success
rate of API calls for the services that are provided by the user-service application.
After you create the alert rules, you can view the two created alert rules on the
page in the EDAS console.
View alert notifications
When the alert rules are triggered, the following alert notifications are received:
Process alerts
After you receive alert notifications, you can view alert notification records and
alert details such as the alert time in the alert management module in the EDAS console.
- Log on to the EDAS console.
- In the left-side navigation pane, choose .
On the
Alarm page, you can view alert notification records and alert details such as the alert
time. For more information, see
View alert events.