Cloud Monitor can push threshold-triggered alert notifications to your O&M system or notification system via HTTP or HTTPS POST. This lets you process alerts programmatically—triggering runbooks, creating incidents, or routing notifications—without polling the Cloud Monitor console.
Prerequisites
Before you begin, ensure that you have:
-
A publicly accessible URL for your O&M system or notification system
-
The following CIDR blocks added to your firewall allowlist:
47.74.206.0/26,47.74.206.64/26,47.74.206.128/26,47.74.206.192/26, and8.222.159.116
How it works
When an alert rule is triggered, Cloud Monitor sends a POST request to the callback URL you configure. The request uses Content-Type: application/x-www-form-urlencoded.
If a callback fails, Cloud Monitor retries up to three times. Each request times out after 5 seconds. Make sure your endpoint responds within this window.
Limitations
You cannot configure multiple threshold-triggered alert callbacks at a time in the Cloud Monitor console. To configure multiple callback URLs, use the API:
-
Call CreateMetricRuleTemplate to create an alert template with a callback URL, then call ApplyMetricRuleTemplate to apply the template to an application group.
-
Call PutGroupMetricRule to create or modify an alert rule for an application group and specify a callback URL.
Configure an alert callback
-
Log on to the Cloud Monitor console.
-
In the left-side navigation pane, choose Alerts > Alert Rules.
-
On the Alert Rules page, find the alert rule you want to modify and click Modify in the Actions column.
NoteTo configure a callback on a new rule, create an alert rule first, then return to this step.
-
In the Modify Alert Rule panel, enter your callback URL in the Alert Callback field.
-
(Optional) Test the callback URL:
-
Click Test next to the callback URL.
-
In the Webhook Test panel, configure Test Template Type and Language, then click Test.
-
Check the returned status code and test result details to verify connectivity.
-
Click Close.
-
-
Click Confirm.
POST request reference
When an alert rule is triggered, Cloud Monitor sends a POST request to your callback URL with the following parameters.
Cloud Monitor may add new parameters in future updates. Make sure your webhook handler accepts and ignores unknown parameters.
Sample request
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
expression=$Average>=95&metricName=Host.mem.usedutilization&instanceName=instance-name-****&signature=eEq1zHuCUp0XSmLD8p8VtTKF****&metricProject=acs_ecs&userId=110803419679****&curValue=97.39&alertName=Basic monitoring-ECS-Memory usage&namespace=acs_ecs_dashboard&triggerLevel=WARN&alertState=ALERT&preTriggerLevel=WARN&ruleId=applyTemplateee147e59-664f-4033-a1be-e9595746****&dimensions={userId=110803419679****, instanceId=i-8psdh7l6lphbn10l****}×tamp=1508136760&productGroupName=test_Group&groupId=1666****&lastTime=2 minutes&rawMetricName=cpu_total®ionId=cn-hangzhou®ionName=China (Hangzhou)&transId=53767d2a-ae72-11ed-b2ca-00163e2c****&unit=%
Parameters
| Parameter | Data type | Description |
|---|---|---|
alertName |
String | The alert name. Example: Basic monitoring-ECS-Memory usage |
alertState |
String | The alert status. Valid values: OK (normal), ALERT (triggered), INSUFFICIENT_DATA (no data found). Example: ALERT |
curValue |
String | The metric value when the alert was triggered or cleared. Example: 97.39 |
dimensions |
String | The resource for which the alert was triggered. Example: {userId=110803419679**, instanceId=i-8psdh7l6lphbn10l**} |
expression |
String | The alert condition. Example: $Average>=95 |
groupId |
String | The ID of the application group. Example: 1666**** |
instanceName |
String | The instance name. Example: instance-name-**** |
lastTime |
String | How long the alert has been active. Unit: minutes. Example: 2 minutes |
metricName |
String | The metric name. For a full list, see the Metric Name column in Appendix 1: Metrics. Example: Host.mem.usedutilization |
metricProject |
String | The name of the cloud service. For most services, metricProject is the same as namespace. For exceptions, see Namespace mappings. Example: acs_ecs |
namespace |
String | The namespace of the cloud service. For most services, namespace is the same as metricProject. For exceptions, see Namespace mappings. For a full list, see Appendix 1: Metrics. Example: acs_ecs_dashboard |
preTriggerLevel |
String | The severity level of the previous alert. Valid values: CRITICAL, WARN, INFO. Example: WARN |
productGroupName |
String | The name of the application group. Example: test_Group |
rawMetricName |
String | The metric ID. For a full list, see the Metric Id column in Appendix 1: Metrics. Example: cpu_total |
regionId |
String | The region ID. Example: cn-hangzhou |
regionName |
String | The region name. Example: China (Hangzhou) |
ruleId |
String | The ID of the alert rule that triggered the alert. Example: applyTemplateee147e59-664f-4033-a1be-e9595746**** |
timestamp |
String | The time when the current alert is triggered. The value is a timestamp. Example: 1508136760 |
transId |
String | The ID of the resource in the rule from the time when an alert is triggered to the time when the alert is cleared. Example: 53767d2a-ae72-11ed-b2ca-00163e2c**** |
triggerLevel |
String | The severity level of the current alert. Valid values: CRITICAL, WARN, INFO. Example: WARN |
unit |
String | The unit of the metric. For a full list, see the Unit column in Appendix 1: Metrics. Example: % |
userId |
String | The user ID. Example: 110803419679**** |
Namespace mappings
For most cloud services, namespace and metricProject in the POST request are identical. The following table lists the services where they differ.
| Cloud service namespace | Callback namespace |
|---|---|
acs_ecs_dashboard |
acs_ecs |
acs_slb_dashboard |
acs_slb |
acs_rds_dashboard |
acs_rds |
acs_oss_dashboard |
acs_oss |
acs_sls_dashboard |
acs_sls |
acs_ess_dashboard |
acs_ess |
acs_containerservice_dashboard |
acs_containerservice |
acs_apigateway_dashboard |
acs_apigateway |
acs_redis_dashboard |
acs_kvstore |
acs_ocs_new |
acs_ocs |
acs_mns_new |
acs_mns |