You can create alert rules for the 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.
Create an alert rule for a general quota item
Before you begin
You must specify the notification type and contact for each type of messages in Message Center. This way, you can receive alert notifications. For more information, see Manage common message settings.
Procedure
In the following example, the Maximum Number of Security Groups quota item of Elastic Compute Service (ECS) is used to describe how to create an alert rule for a general quota item. The alert condition is that if the quota usage of the quota item reaches or exceeds 80%, alert notifications are sent to the current Alibaba Cloud account by using emails.
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 the Maximum Number of Security Groups quota item.
On the Create Alarm Rule page, configure the parameters in the following table and click Confirm.
Table 1 Parameters for creating an alert rule for a general quota item
Parameter
Description
Example
Alarm Rule Name
The name of the alert rule.
Number of security groups reaches 80% of the threshold
Alarm Metric
The metric used by the alert rule. Valid values:
Used Quotas
Percentage of Used Quotas(%)
Available Quotas
Percentage of Available Quotas(%)
Percentage of Used Quotas(%)
Threshold
The alert threshold.
When the Alarm Metric parameter is set to Used Quotas, alert notifications are sent to the current Alibaba Cloud account if the quota usage of the specified quota item reaches or exceeds the threshold.
When the Alarm Metric parameter is set to Percentage of Used Quotas(%), alert notifications are sent to the current Alibaba Cloud account if the quota usage of the specified quota item in percentage reaches or exceeds the threshold. Valid values: [50%,100%].
When the Alarm Metric parameter is set to Available Quotas, alert notifications are sent to the current Alibaba Cloud account if the remaining quota of the specified quota item is less than or equal to the threshold.
When the Alarm Metric parameter is set to Percentage of Available Quotas(%), alert notifications are sent to the current Alibaba Cloud account if the percentage of the remaining quota of the specified quota item is less than or equal to the threshold. Valid values: (0%,50%].
NoteQuota Center monitors the real-time limit of a general quota item and calculates the percentage of used quota and percentage of remaining quota based on the quota usage and quota limit.
80%
Notification Methods
The method used for sending alert notifications. By default, alert notifications are sent by using emails.
Email
Alarm Callback
Quota Center allows you to use the alert callback feature to subscribe to alerts. Your O&M system can automatically initiate a process to increase a quota based on the alert callback content.
Quota Center sends an alert notification by using an HTTP POST request to the specified Internet URL.
For more information about the examples of alert callback requests and parameters in an alert callback request, see What is the request content of an alert callback?
NoteBy default, Quota Center sends an alert notification about 15 minutes after the specified alert threshold is reached.
If your alert callbacks are integrated with the webhook of a DingTalk chatbot, you must set the custom keyword of the DingTalk chatbot to Alert and then copy the webhook URL as the URL to receive alert callbacks.
http://alert.aliyun.com:8080/callback
Create an alert rule for an API rate limit
Billing
The alerting feature for API rate limits is integrated based on the alerting capability of CloudMonitor. Alert notifications sent based on the created alert rules consume the notification quotas of CloudMonitor, as described in the following list:
Phone calls: No free quota is provided. You need to enable the pay-as-you-go billing mode 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 mode 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 to create alert rules for API rate limits a Resource Access Management (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 by using 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 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 current Alibaba Cloud account by using emails.
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 parameters in the following table and click Confirm.
Table 2 Parameters for creating an alert rule for an API rate limit
Parameter
Description
Example
Alarm Rule Name
The name of the alert rule.
Associate ApsaraDB RDS instances with a scaling group
Alarm Metric
The metric used by the alert rule. Valid values:
Quotas
Used Quotas
Percentage of Used Quotas(%)
Percentage of Available Quotas(%)
Quotas
Threshold and Alarm 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 Cycles, 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 alert 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: Warn. The default notification method for this alert level is Email and Callback.
Threshold: ≥ 250.
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.
Auto Scaling Administrator
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 more 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.
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 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 alert contact in the alert contact group by using emails.
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 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 general quota item in this topic.
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.