Create alert rules for the general quotas and API rate limits of your cloud services. When the monitoring metric of a quota item reaches the alert condition, you receive an alert notification so that you can request a quota increase in time.
Prerequisites
Create alert contacts and an alert contact group in the CloudMonitor console to receive alert notifications. For more information, see Create an alert contact or an alert contact group.
If you use a Resource Access Management (RAM) user to manage quota alerts, the RAM user must have the Quota Center management permission (
The following custom policy grants the required permissions. For more information, see Create a custom permission policy and Manage permissions for a RAM user.AliyunQuotasFullAccess) and the permissions to create and delete quota alerts in CloudMonitor.
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"cms:PutMetricRuleTargets",
"cms:PutResourceMetricRules",
"cms:DeleteMetricRules",
"cms:DeleteMetricRuleTargets"
],
"Resource": "*"
}
],
"Version": "1"
}Billing
Quota alerts use the alerting capability of CloudMonitor. Whether a quota alert incurs charges depends on its notification methods, which are billed as follows:
Email and alert callback: Both are free of charge.
Procedure
You can create a quota alert for a general quota or an API rate limit. For each quota type, you can monitor a single quota item or all quota items of a cloud service. The following table describes which path to use.
| What you want to monitor | Path |
| A single general quota of a cloud service, such as the maximum number of vCPUs for spot instances | Single-quota alert. See Create a general quota alert and click the Create a single-quota alert tab. |
| All general quotas of a cloud service, by usage percentage or available percentage | Global alert rule. See Create a general quota alert and click the Create a global alert rule tab. |
| A single API rate limit of a cloud service, such as the rate limit of a specific API operation | Single-quota alert. See Create an API rate limit alert and click the Create a single-quota alert tab. |
| All API rate limits of a cloud service, by usage percentage or available percentage | Global alert rule. See Create an API rate limit alert and click the Create a global alert rule tab. |
The console labels quota alert features with Alarm, such as Alarm Settings, Create Alarm Rule, and Alarm Rule Name.
Create a general quota alert
Create a single-quota alert
A single-quota alert monitors a single general quota of a specific cloud service.
For example, you can create a quota alert for the Maximum vCPUs for Spot Instances quota of Elastic Compute Service (ECS), which has a value of 512. When the actual number of vCPUs for spot instances reaches 80% of the quota or more, an alert notification is sent by email to the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose Products>General Quotas.
On the Products with General Quotas page, click the cloud service that you want to monitor in the corresponding category. For example, click ECS Quotas by Instance Type in the Elastic Computing section.
Find the quota item that you want to monitor, such as Maximum vCPUs for Spot Instances, and click Create Alert in the Actions column.
On the Create Alarm Rule page, configure the alert rule, and then click Confirm. At minimum, set the rule name, the alert metric, the threshold and alert level, and the alert contact group. For more information about the parameters, see Alert rule parameters.
After you click Confirm, the quota alert is created. To view the details of the alert rule, see View a list of quota alerts and their details.
Create a global alert rule
A global alert rule monitors all general quotas of a specific cloud service. An alert is triggered when the usage percentage or the available percentage of any general quota of the cloud service reaches the threshold. A global alert rule supports only Usage percentage (%) and Available percentage (%) as the alert metric.
For example, you can create a global alert rule for ECS Quotas by Instance Type. When the usage percentage of any general quota reaches 80% or more, an alert notification is sent by email to the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose Products>General Quotas.
On the Products with General Quotas page, click the cloud service that you want to monitor in the corresponding category. For example, click ECS Quotas by Instance Type in the Elastic Computing section.
In the upper-right corner of the page, click Global alarm rules.
On the Create Alarm Rule page, configure the alert rule, and then click Confirm. At minimum, set the rule name, the alert metric, the threshold and alert level, and the alert contact group. For more information about the parameters, see Alert rule parameters.
After you click Confirm, the quota alert is created. The other parameters are the same as those of a single-quota alert. To view the details of the alert rule, see View a list of quota alerts and their details.
Create an API rate limit alert
Create a single-quota alert
A single-quota alert monitors a single API rate limit of a specific cloud service.
For example, you can create a quota alert for AttachDBInstances of Auto Scaling, which has a rate limit of 300 calls per 60 seconds. When the actual number of calls reaches 250 calls per 60 seconds or more, an alert notification is sent by email to the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose Products>API Rate Limits.
On the Products with API Rate Limits page, click the cloud service that you want to monitor in the corresponding category. For example, click Auto Scaling in the Elastic Computing section.
Find the API rate limit that you want to monitor, such as AttachDBInstances, and click Create Alert in the Actions column.
On the Create Alarm Rule page, configure the alert rule, and then click Confirm. At minimum, set the rule name, the alert metric, the threshold and alert level, and the alert contact group. For more information about the parameters, see Alert rule parameters.
After you click Confirm, the quota alert is created. To view the details of the alert rule, see View a list of quota alerts and their details.
Create a global alert rule
A global alert rule monitors all API rate limits of a specific cloud service. An alert is triggered when the usage percentage or the available percentage of any API rate limit of the cloud service reaches the threshold. A global alert rule supports only Usage percentage (%) and Available percentage (%) as the alert metric.
For example, you can create a global alert rule for Auto Scaling. When the usage percentage of any API rate limit reaches 80% or more, an alert notification is sent by email to the alert contacts in the alert contact group.
Log on to the Quota Center console.
In the left-side navigation pane, choose Products>API Rate Limits.
On the Products with API Rate Limits page, click the cloud service that you want to monitor in the corresponding category. For example, click Auto Scaling in the Elastic Computing section.
In the upper-right corner of the page, click Global alarm rules.
On the Create Alarm Rule page, configure the alert rule, and then click Confirm. At minimum, set the rule name, the alert metric, the threshold and alert level, and the alert contact group. For more information about the parameters, see Alert rule parameters.
After you click Confirm, the quota alert is created. The other parameters are the same as those of a single-quota alert. To view the details of the alert rule, see View a list of quota alerts and their details.
Alert rule parameters
The following table describes the parameters that you configure when you create a quota alert. The parameters apply to both single-quota alerts and global alert rules.
| Parameter | Description | Example |
| Alarm Rule Name | The name of the alert rule. | Maximum vCPUs for Spot Instances alert rule |
| Alarm Metric | The metric of the quota alert. Quota and Quota usage are available only for single-quota alerts. A global alert rule supports only Usage percentage (%) and Available percentage (%) as the alert metric. Valid values: - Quota - Quota usage - Usage percentage (%) - Available percentage (%) | Usage percentage (%) |
| Threshold and Alarm Level | The alert level and the threshold that corresponds to the level. The notification methods for each alert level are as follows: - Critical: email and alert callback. - Warn: email and alert callback. - Info: email and alert callback. You must also select the number of consecutive periods during which the metric reaches the alert threshold before a notification is sent. Valid values: 1, 3, 5, 10, 15, 30, 60, 70, 90, 120, and 180. You can configure multiple alert levels. When the metric value falls into a different threshold range, the alert maps to a different level, and CloudMonitor sends the notification through the corresponding channels. |
|
| Mute Period | The interval at which CloudMonitor resends a notification if the alert is not cleared. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours. After a notification is sent, CloudMonitor does not send a duplicate notification while the metric stays above the threshold within the mute period. If the metric is still abnormal after the mute period ends, CloudMonitor sends the notification again. For example, if you set Mute Period to 24 hours and the alert is not cleared, CloudMonitor resends the notification after 24 hours. | 5 minutes |
| Effective time | The effective time of the alert rule. Notifications are sent only within the specified time range on the specified days, from Monday to Sunday. |
|
| Alarm Contact Group | The alert contact group that receives alert notifications. An alert contact group contains one or more alert contacts, and alert notifications are sent to these contacts. For more information about how to create alert contacts and alert contact groups, see Create an alert contact or an alert contact group. | ECS quota administrator |
| Alert callback | The URL that receives the alert information that CloudMonitor pushes by using POST requests. The URL must be accessible over the Internet. Only HTTP is supported. | http://alert.aliyun.com:8080/callback |
| Labels | The tags of the alert rule. You can configure up to six tags. | k1,v1 |
| Push Channel | The channels to which the alert information is delivered. Valid values: - Simple Log Service: If you turn on Simple Log Service, the alert information is sent to a Logstore of Simple Log Service when an alert is triggered. You must specify the Region, ProjectName, and Logstore of Simple Log Service. For more information about Simple Log Service log collection, see Collect and analyze ECS text logs by using Logtail. - Message Service - topic: If you turn on Message Service - topic, the alert information is sent to a topic of Simple Message Queue (formerly MNS) when an alert is triggered. You must specify the region and the topic of 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, the alert notification is sent to Function Compute for formatting when an alert is triggered. You must specify the region, the service, and the function of Function Compute. For more information about how to create a service and a function, see Create a function. | Turn off the switch |
| Recovery Notification | Specifies whether to send a recovery notification when the alert is cleared. By default, this switch is turned on. | Turn on the switch |
| Method to handle alarms when no monitoring data is found | The action to take when no monitoring data is available. Valid values: - Do not do anything (default) - Send alarm notifications - Treated as normal | Do not do anything |
To test the connectivity of the alert callback URL
Click Test next to the callback URL.
On the Test Result page, use the status code and the test result details that the webhook returns to check and troubleshoot the connectivity of the alert callback URL.
You can also set the Language of the webhook and click Test again to get the corresponding test result details.
Click Close.
Next steps
After you create a quota alert, you can perform the following operations:
View the details of the quota alert. For more information, see View a list of quota alerts and their details.
View the alert history of the quota. For more information, see Query the alert history of a quota.
Request an increase of the quota when you receive an alert for a quota item. For more information, see Create a quota increase application.
Alternatively, you can create API rate limit alerts directly in the CloudMonitor console. For more information, see Create a global alert for API rate limits and Quota monitoring.