You can create alert rules to monitor the usage and status of Alibaba Cloud service resources. If resource metrics meet specific alert conditions, alerts are triggered and CloudMonitor sends alert notifications. This way, you can identify and handle the exceptions of monitoring data at the earliest opportunity.
Procedure
Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
On the Alert Rules page, click Create Alert Rule.
In the Create Alert Rule panel, configure the parameters. The following table describes the parameters.
Example: Configure an alert rule for the CPU utilization of all Elastic Compute Service (ECS) instances. If the maximum CPU utilization is greater than or equal to 85% for three consecutive cycles, alert notifications are sent to all alert contacts in the alert contact group Alarm_Group by using emails and webhooks.
Select Elastic Compute Service (ECS) for Product and All Resources for Resource Range.
Configure trigger conditions for the alert rule.
Click Add Rule and select a metric type from the drop-down list.
In the Configure Rule Description panel, enter a rule name in the Alert Rule field, set Metric Type to Simple Metric, and select
from the Metric drop-down list. In the Critical section, select 3 Consecutive Cycles (1 Cycle = 1 Minutes) and set the trigger condition to Maximum Value >= 85%.Click OK.
Select Alarm_Group from the Alert Contact Group drop-down list. Retain the default settings of other parameters.
Table 1. Parameters of an alert rule
Parameter
Description
Product
The name of the Alibaba Cloud service that can be monitored by CloudMonitor. For example, you can select ApsaraDB RDS.
Resource Range
The range of the resources to which the alert rule applies. Valid values:
All Resources: The alert rule applies to all resources of the specified cloud service.
Application Groups: The alert rule applies to all resources in the specified application group of the specified cloud service.
Instances: The alert rule applies to the specified resources of the specified cloud service.
Rule Description
The content of the alert rule. The parameters in this section specify the conditions that trigger an alert. To specify the rule description, perform the following steps:
Click Add Rule and select a metric type from the drop-down list.
In the Configure Rule Description panel, enter a rule name in the Alert Rule field and configure the Metric Type parameter. Valid values of the Metric Type parameter:
Simple Metric: Select a metric and set the threshold and alert level for the metric.
Combined Metrics: Select an alert level and specify alert conditions for two or more metrics in the Multi-metric Alert Condition section.
NoteIf a multi-metric alert rule is configured, the desired resource must have data on each metric. An alert can be triggered only if the related conditions are met. For example, if a multi-metric alert rule includes Internet metrics but the ECS instance is not configured with an elastic IP address (EIP), alerts cannot be triggered.
Expression: Select an alert level and then configure an alert expression.
Dynamic Threshold: For more information about dynamic thresholds, see Overview and Create dynamic threshold-triggered alert rules.
NoteThe dynamic threshold feature is in invitational preview. To use the feature, you must submit a ticket.
Click OK.
NoteFor more information about how to specify complex alert conditions, see Alert rule expressions.
Mute For
The interval at which CloudMonitor resends alert notifications before an alert is cleared. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours.
If a metric value reaches the threshold, CloudMonitor sends an alert notification. If the metric value reaches the threshold again within the mute period, CloudMonitor does not resend an alert notification. If the alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.
For example, if the Mute For parameter is set to 12 Hours and the alert is not cleared, CloudMonitor resends an alert notification after 12 hours.
Effective Period
The period during which the alert rule is effective. CloudMonitor sends alert notifications based on the alert rule only within the effective period.
NoteIf an alert rule is not effective, no alert notification is sent. However, the alert history is still displayed on the Alert History page.
Alert Contact Group
The alert contact groups to which alert notifications are sent.
The alert notifications of the application group are sent to the alert contacts that belong to the selected alert contact groups. An alert contact group can contain one or more alert contacts.
For more information about how to create an alert contact and an alert contact group, see Create an alert contact or alert contact group.
Tag
The tag of the alert rule. A tag consists of a tag key and a tag value.
NoteYou can set a maximum of six tags.
Alert Callback
The callback URL that can be accessed over the Internet. CloudMonitor sends HTTP POST requests to push alert notifications to the specified URL. Only HTTP requests are supported. For more information about how to configure alert callback, see Use the alert callback feature to send notifications about threshold-triggered alerts.
To test the connectivity of an alert callback URL, perform the following steps:
Click Test next to the callback URL.
In the Webhook Test panel, you can check and troubleshoot the connectivity of the alert callback URL based on the returned status code and test result details.
NoteTo obtain the details of the test result, configure the Test Template Type and Language parameters and click Test.
Click Close.
NoteYou can click Advanced Settings to configure this parameter.
Auto Scaling
If you turn on Auto Scaling, the specified scaling rule is enabled when an alert is triggered. In this case, you must configure the Region, ESS Group, and ESS Rule parameters.
For more information about how to create a scaling group, see Manage scaling groups.
For more information about how to create a scaling rule, see Manage scaling rules.
NoteYou can click Advanced Settings to configure this parameter.
Simple Log Service
If you turn on Simple Log Service, the alert information is sent to the specified Logstore when an alert is triggered. In this case, you must configure the Region, ProjectName, and Logstore parameters.
For more information about how to create a project and a Logstore, see Getting Started.
NoteYou can click Advanced Settings to configure this parameter.
Simple Message Queue (formerly MNS) - Topic
If you turn on Simple Message Queue (formerly MNS) - Topic, the alert information is sent to the specified topic in Simple Message Queue (formerly MNS) (SMQ) when an alert is triggered. In this case, you must configure the Region and topicName parameters.
For more information about how to create a topic, see Create a topic.
NoteYou can click Advanced Settings to configure this parameter.
Function Compute
If you turn on Function Compute, an alert notification is sent to Function Compute for format processing when an alert is triggered. In this case, you must configure the Region, Service, and Function parameters.
For more information about how to create a service and a function, see Quickly create a function.
NoteYou can click Advanced Settings to configure this parameter.
Method to handle alerts when no monitoring data is found
The method that is used to handle alerts when no monitoring data is found. Valid values:
Do not do anything (default)
Send alert notifications
Treated as normal
NoteYou can click Advanced Settings to configure this parameter.
Click Confirm.