You can use alert rules to monitor resource usage across Alibaba Cloud services. When a monitored metric meets an alert condition, Cloud Monitor automatically sends an alert notification. This helps you quickly detect abnormal monitoring data and take prompt action.
Procedure
-
Log on to the Cloud Monitor console.
In the navigation pane on the left, choose .
On the Alert Rules page, click Create Alert Rule.
In the Create Alert Rule panel, configure the parameters for the alert rule.
Example: Set an alert rule that sends an alert notification to all alert contacts in the Alert Contact Group when the maximum CPU utilization of any Elastic Compute Service instance is greater than or equal to the 85% threshold for three consecutive epochs(Notification methods: Email + WebHook).
Select Product as Elastic Compute Service (ECS). Select Resource Range as All Resources.
Configure the rule conditions.
Click Add Rule and select the appropriate metric type from the drop-down menu.
In the Configure Rule Description panel, enter a Alert Rule. For Metric Type, select Simple Metric. For Metric, select . In the Critical section, set the trigger condition to three consecutive periods (one period equals one minute) and set the maximum value to be greater than or equal to 85%.
Click OK.
Table 1. Parameter descriptions for alert rules
Parameter
Description
Product
The name of an Alibaba Cloud service that Cloud Monitor supports. For example: ApsaraDB RDS.
Resource Range
The scope of resources to which the alert rule applies. Valid values:
All Resources: The alert rule applies to all resources of the specified product. It also applies to new resources added later.
Application Groups: The alert rule applies to all resources in the specified application group of the selected product. It also applies to new resources added later.
Instances: The alert rule applies to the specified resource of the selected product.
Rule Description
The core definition of the alert rule. Cloud Monitor triggers the rule when monitoring data meets the alert condition. To configure the rule description:
Click Add Rule. In the drop-down menu, select the appropriate metric type.
In the Configure Rule Description panel, first enter a Alert Rule. Then define the rule conditions.
Simple Metric: First select a monitoring metric. Then set its threshold and alert level.
Combined Metrics: First select an alert level. Then define a multi-metric alert condition using two or more monitoring metrics.
NoteIf you define a multi-metric alert rule, the target resource must report data for every metric. Otherwise, the alert will not trigger. For example, if your multi-metric alert includes a public network metric but the ECS instance has no public IP address, the alert will not trigger.
Expression: First select an alert level. Then define an alert expression.
Dynamic Threshold: For more information about smart thresholds, see Overview and Create a smart threshold alert rule.
NoteFor more information about complex alert expressions, see Alert rule expression reference.
Mute Period
The interval between repeated alert notifications when an alert remains active and unacknowledged. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours.
When a metric crosses its alert threshold, Cloud Monitor sends an alert. If the metric stays above the threshold during the mute period, Cloud Monitor does not send another alert. If the metric remains above the threshold after the mute period ends, Cloud Monitor sends another alert.
For example, if you set the Mute Period to 12 hours and the alert remains active, Cloud Monitor sends another alert 12 hours later.
Effective Period
The time range during which the alert rule is active. Cloud Monitor sends alerts only during this period.
NoteWhen the alert rule is outside its effective period, Cloud Monitor does not send alerts. However, alert history records still appear in the alert history list.
Alert Contact Group
The group of contacts who receive alert notifications.
Alert notifications for an application group are sent to all contacts in this alert contact group. An alert contact group contains one or more alert contacts.
To create alert contacts or an alert contact group, see Create an alert contact or alert contact group.
Tag
A tag for the alert rule. Each tag has a name and a value.
NoteYou can add up to six tags.
Alert Callback
A publicly accessible URL that receives alert data from Cloud Monitor via HTTP POST requests. Only HTTP is supported. For instructions, see Use threshold-based alert callbacks.
To test connectivity to your alert callback URL, do the following.
Click Test, located directly to the right of the callback URL.
In the WebHook Test panel, use the HTTP status code and test result details to verify and troubleshoot connectivity to your alert callback URL.
NoteYou can also set the Test Template Type: and Language:. Then click Test again to view updated test results.
Click Close.
NoteClick Advanced Settings to configure this parameter.
Auto Scaling
If you enable Auto Scaling, Cloud Monitor triggers the associated scaling rule when an alert occurs. You must specify the Region, ESS Group, and ESS Rule.
To create a scaling group, see Configure a scaling group.
To create a scaling rule, see Configure a scaling rule.
NoteClick Advanced Settings to configure this parameter.
Simple Log Service
If you enable Simple Log Service, Cloud Monitor sends alert data to a Logstore in Simple Log Service when an alert occurs. You must specify the Region, ProjectName, and Logstore.
To create a project and Logstore, see Collect and analyze ECS text logs using LoongCollector.
NoteClick Advanced Settings to configure this parameter.
Simple Message Queue (formerly MNS) - Topic
If you enable Simple Message Queue (formerly MNS) - Topic, Cloud Monitor sends alert data to a topic in Message Service when an alert occurs. You must specify the region and topic.
To create a topic, see Create a topic.
NoteClick Advanced Settings to configure this parameter.
Function Compute
If you enable Function Compute, Cloud Monitor sends alert notifications to Function Compute for custom formatting when an alert occurs. You must specify the region, service, and function.
To create a service and function, see Quickly create a function.
NoteClick Advanced Settings to configure this parameter.
Method to handle alerts when no monitoring data is found
How Cloud Monitor handles alerts when no monitoring data is available. Valid values:
Do not do anything (default)
Send alert notifications
Treated as normal
NoteClick Advanced Settings to configure this parameter.
Click Confirm.