You can create alert rules for general quota items and API rate limits of Alibaba Cloud services. This way, if the metric value of a quota item reaches the specified threshold, Quota Center sends alert notifications to you. Then, you can submit an application to increase the relevant quota value at the earliest opportunity.
Billing
The quota alerting feature integrates the alerting capability of CloudMonitor. Alert notifications that are sent based on the created alert rules consume the notification quotas of CloudMonitor. The following billing rules apply based on the notification method:
Phone calls: No free quota is provided. You need to enable the pay-as-you-go billing method or purchase resource plans. For more information, see Pay-as-you-go and Resource plans.
SMS messages: The free quota is 1,000 messages per month. You need to enable the pay-as-you-go billing method or purchase resource plans if the free quota is used up. For more information, see Free quotas, Pay-as-you-go, and Resource plans.
Emails and alert callbacks: These two notification methods are both free of charge.
Before you begin
You must create an alert contact and an alert contact group in the CloudMonitor console to receive alert notifications. For more information, see Create an alert contact or alert contact group.
If you create quota alert rules as a RAM user, you must attach the AliyunQuotasFullAccess policy to the RAM user and grant the RAM user the permissions to create and delete alert rules for quota items in CloudMonitor.
Grant the following permissions to the RAM user. For more information, see Create custom policies and Grant permissions to a RAM user.
{ "Statement": [ { "Effect": "Allow", "Action": [ "cms:PutMetricRuleTargets", "cms:PutResourceMetricRules", "cms:DeleteMetricRules", "cms:DeleteMetricRuleTargets" ], "Resource": "*" } ], "Version": "1" }
Procedure
Create an alert rule for a general quota item
Create a single alert rule
You can create a single alert rule for a general quota item of a cloud service.
In the following example, a quota alert rule for the maximum number of vCPUs of Elastic Compute Service (ECS) preemptible instances for a limited purchase (the quota is 512 vCPUs) is created. If the actual number of vCPUs of preemptible instances is greater than or equal to 80% of the quota, an alert notification is sent to the email addresses of the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose
.In the Elastic Compute section of the Products with General Quotas page, click Elastic Compute Service.
Click Create Alarm Rule in the Actions column of vCPUs Assigned to Limited Spot Instance.
On the Create Alarm Rule page, configure the parameters and click Confirm.
Table 1 Parameters for creating an alert rule for a quota item
Parameter
Description
Example
Alarm Rule Name
The name of the alert rule.
Maximum number of vCPUs for preemptible instances for limited purchase
Alarm Metric
The metric used by the alert rule. Valid values:
Quotas
Used Quotas
Percentage of Used Quotas(%)
Percentage of Available Quotas(%)
Percentage of Used Quotas(%)
Threshold and Alert Level
The alert level and the threshold corresponding to this level.
The following default notification methods are set for different alert levels:
Critical: Email and Callback
Warning: Email and Callback
Info: Email and Callback
You also need to select the number of times that the threshold is reached before an alert is triggered. Valid values: 1 Consecutive Cycle, 3 Consecutive Cycles, 5 Consecutive Cycles, 10 Consecutive Cycles, 15 Consecutive Cycles, 30 Consecutive Cycles, 60 Consecutive Cycles, 70 Consecutive Cycles, 90 Consecutive Cycles, 120 Consecutive Cycles, and 180 Consecutive Cycles.
You can configure settings for different alert levels. This way, CloudMonitor generates alerts at a specific level based on the threshold corresponding to the level and sends alert notifications by using the specified methods.
Alert level: Info. The default notification method for this alert level is Email and Callback.
Threshold: ≥ 80%.
Mute For
The interval at which alert notifications are sent if the generated alert is not cleared. The value also indicates the silence period. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours.
An alert notification is sent when a metric reaches the alert threshold. During the silence period, if the metric repeatedly exceeds the alert threshold, no new alert notification is sent. After the silence period ends, if the metric does not return to the normal state, a new alert notification is sent.
For example, if you set the Mute For parameter to 24 hours, CloudMonitor sends an alert notification for a generated alert, and the alert remains unresolved, CloudMonitor sends a new alert notification after 24 hours.
5 minutes
Effective Time
The period during which the alert rule takes effect. The alert rule takes effect and generates alerts only at the specified time on the specified days of a week.
Cycle: Monday to Sunday
Time: 00:00 to 23:59
Alarm Contact Group
The contact group to which alert notifications are sent.
Alert notifications for an application group are sent to the alert contact in the alert contact group. An alert contact group is a group of alert contacts, containing one or more alert contacts.
For more information about how to create an alert contact or an alert contact group, see Create an alert contact or alert contact group.
Quota Administrators of ECS Instance Types
Alarm Callback
The URL that is accessible over the Internet to receive the alert information pushed by CloudMonitor by using HTTP POST requests. Only the HTTP protocol is supported.
To test the connectivity of the callback URL, perform the following operations:
Click Test next to the callback URL.
On the Test Result page, you can check the connectivity of the callback URL based on the returned status code and test result details.
NoteYou can also set the Language parameter and then click Test again to obtain test result details of the specified language.
Click Close.
http://alert.aliyun.com:8080/callback
Labels
The tags of the alert rule. A tag consists of a tag key and a tag value. You can specify up to six tags for an alert rule.
k1,v1
Push Channel
The Alibaba Cloud service used to deliver alert information. Valid values:
Simple Log Service
If you turn on Simple Log Service, when an alert is generated, alert information is sent to a Logstore in Simple Log Service. In this case, you must configure the Region, ProjectName, and Logstore parameters.
For information about how to create a project and a Logstore, see Getting Started.
Message Service - topic
If you turn on Message Service - topic, when an alert is generated, alert information is sent to a topic in Simple Message Queue (formerly MNS). In this case, you must specify a region and a topic.Simple Message Queue (formerly MNS)
For more information about how to create a topic, see Create a topic.
Function Compute
If you turn on Function Compute, when an alert is generated, alert information is sent to Function Compute to be formatted. In this case, you must specify a region, a service, and a function.
For information about how to create a service and a function, see Quickly create a function.
Turn off all switches
Recovery Notification
Specifies whether to send notifications when alerts are cleared. The switch is turned on by default.
Turn on the switch
Method to handle alarms when no monitoring data is found
The method that is used to handle alerts when no monitoring data is available. Valid values:
Do not do anything (default)
Send alarm notifications
Treated as normal
Do not do anything
Create a global alert rule
You can create a global alert rule for all general quota items of a cloud service. If the percentage of used quota or remaining quota of a general quota item reaches the threshold, an alert is triggered.
In the following example, a global alert rule for ECS Quotas by Instance Type is created to describe how to create a global alert rule for a cloud service. If the percentage of used quota reaches 80% of the threshold, alert notifications are sent to the email addresses of the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose
.In the Elastic Compute section of the Products with General Quotas page, click Elastic Compute Service.
On the page that appears, click Global alarm rules in the upper-right corner.
On the Create Alarm Rule page, configure the parameters and click Confirm.
The Alarm Metric parameter for a global alert rule supports valid values of only Percentage of Used Quotas(%) and Percentage of Available Quotas(%). Other parameters for a global alert rule are the same as those for a single alert rule. For more information, see Table 1 Parameters for creating an alert rule for a quota item in this topic.
Create an alert rule for an API rate limit
Create a single alert rule
You can create a single alert rule for an API rate limit of a cloud service.
In the following example, the rate limit on the AttachDBInstances operation of Auto Scaling is used to describe how to create an alert rule for an API rate limit. The API rate limit is 300 calls per 60 seconds, and the alert condition is that if the number of calls to the API operation within 60 seconds reaches or exceeds 250, alert notifications are sent to the email addresses of the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose
.In the Elastic Compute section of the Products with API Rate Limits page, click Auto Scaling.
Search for the AttachDBInstances operation by entering keywords in the search box. Then, click Create Alarm Rule in the Actions column.
On the Create Alarm Rule page, configure the parameters in the following table and click Confirm.
For more information about the parameters, see Table 1 Parameters for creating an alert rule for a quota item in this topic.
Create a global alert rule
You can create a global alert rule for all API rate limits of a cloud service. If the percentage of used quota or remaining quota of calls to an API operation reaches the threshold, an alert is triggered.
In the following example, a global alert rule for Auto Scaling is created to describe how to create a global alert rule for a cloud service. The alert condition is that if the number of calls to an API operation reaches 80% of the threshold, alert notifications are sent to the email addresses of the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose
.In the Elastic Compute section of the Products with API Rate Limits page, click Auto Scaling.
On the API Rate Limits page, click Global alarm rules in the upper-right corner.
On the Create Alarm Rule page, configure the parameters and click Confirm.
The Alarm Metric parameter for a global alert rule supports valid values of only Percentage of Used Quotas(%) and Percentage of Available Quotas(%). Other parameters for a global alert rule are the same as those for a single alert rule. For more information about the parameters, see Table 1 Parameters for creating an alert rule for a quota item in this topic.
References
You can also create alert rules for API rate limits in the CloudMonitor console. For more information, see Create a global alert rule for all API rate limits of a cloud service and Quota monitoring.
What to do next
You can view the details of an alert rule created for a quota item. For more information, see View alert rules created for quota items and rule details.
You can view the alert notifications that are sent based on an alert rule created for a quota item. For more information, see View the alert notification history of an alert rule for a quota item.
You can submit an application to increase the relevant quota value after you receive an alert notification. For more information, see Submit an application to increase a quota.