Create alert rules in CloudMonitor to monitor resource usage across Alibaba Cloud products, on-premises IDCs, other cloud vendors, Prometheus, binary logs, SLS logs, and custom monitoring data. When a metric meets the alert condition, CloudMonitor automatically sends a notification.
Prerequisites
Make sure that you have created a metric repository. For more information, see Create a metric repository.
Limits
An Alibaba Cloud account can create a maximum of 20 alert rules.
Procedure
-
Log on to the Cloud Monitor console.
-
In the navigation pane on the left, choose .
-
On the Metric Repository page, click Create Alert in the upper-left corner.
-
In the Create Alert Rule panel, set the parameters for the alert rule.
Parameter
Description
Rule Name
The name of the alert rule.
Metric Repository
The metric repository to which the alert rule applies.
Alert Expression
The expression that defines the alert condition. The alert rule is triggered when a metric meets this condition.
Tags
The tags of the alert rule. Each tag consists of a key and a value.
Comments
The comments for the alert rule. Each comment consists of a key and a value.
Mute Period
-
The interval at which an alert of the same level is re-triggered if the alert is not resolved. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours.
-
When a metric reaches its alert threshold, an alert notification is sent. If the alert level remains unchanged during the mute period, no more notifications are sent. The rule triggers another alert only when the alert level changes (including returning to Normal) or the mute period expires.
NoteAlert history has two states. One is the mute period, which means no notifications are sent for the same resource during this period. The other is notification silence, which means no notifications are sent for different resources during this period.
-
For example, if you set Mute For to 12 hours, CloudMonitor resends an alert notification after 12 hours if the alert is not resolved.
Effective Time
The period during which the alert rule is active. Metrics are checked for alerts only during this period.
Alert Contact Group
The contact group that receives alert notifications.
Alert notifications are sent to all contacts in this group. A contact group can contain one or more contacts.
For more information about how to create alert contacts and alert contact groups, see Create an alert contact or an alert contact group.
Alert Level
The alert level and notification method. Valid values:
Standard (Email and Webhook)
The number of consecutive alert epochs can be set to 1, 3, 5, 10, 15, 30, 60, 70, 90, 120, and 180. One epoch is equal to 1 minute.
Alert Callback
A public URL that receives alert notifications from CloudMonitor through HTTP POST requests. Only the HTTP protocol is supported.
To test connectivity to the callback URL:
-
Click Test, located directly to the right of the callback URL.
In the WebHook Test panel, check the HTTP status code and test result details to verify connectivity.
NoteYou can also set the Test Template Type: and Language:. Then click Test again to view updated test results.
-
Click Close.
Auto Scaling
If you enable Auto Scaling, the corresponding scaling rule is triggered when an alert occurs. You must specify the Region, Scaling Group, and Scaling Rule.
-
For more information about how to create a scaling group, see Configure a scaling group.
-
For more information about how to create a scaling rule, see Configure a scaling rule.
Simple Log Service
If you enable Simple Log Service, alert information is written to SLS when an alert occurs. You must specify the Region, ProjectName, and Logstore.
For more information about how to create a Project and a Logstore, see Use LoongCollector to collect and analyze text logs of an ECS instance.
Simple Message Queue (formerly MNS) — topic
If you enable Simple Message Queue (formerly MNS) — topic, alert information is written to a Message Service topic when an alert occurs. You must specify the region and topic.
For more information about how to create a topic, see Create a topic.
Function Compute
If you enable Function Compute, alert notifications are sent to Function Compute for processing when an alert occurs. You must specify the region, service, and function.
For more information about how to create a service and a function, see Quickly create a function.
No Data Processing
How to handle alerts when no monitoring data is available. Valid values:
-
Do not process
-
Send no-data alert
-
Mark as resolved (Default)
-
-
Click OK.
-
You can view the created alert rule.
In the navigation pane on the left, choose .
On the Alert Rules page, find the rule that you created. The value in the Product Name column for this rule is Prometheus.