Queries the resources for which active alerts are triggered based on an alert rule.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeAlertingMetricRuleResources |
The operation that you want to perform. Set the value to DescribeAlertingMetricRuleResources. |
RuleId | String | No | putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108**** |
The ID of the alert rule. For information about how to obtain the ID of an alert rule, see DescribeMetricRuleList. |
GroupId | String | No | 7671**** |
The ID of the application group. For information about how to obtain the ID of an application group, see DescribeMonitorGroups. |
Page | Integer | No | 1 |
The number of the page to return. Default value: 1. |
PageSize | Integer | No | 10 |
The number of entries to return on each page. Default value: 10. |
Namespace | String | No | acs_mns_new |
The namespace of the cloud service. For more information about the namespaces of cloud services, see ~~163515~~. |
Dimensions | String | No | {\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"} |
The dimensions that specify the resources for which you want to query custom metrics. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 0724011B-D9E0-4B2F-8C51-F17A894CC42C |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call was successful. Valid values:
|
Code | Integer | 200 |
The HTTP status code. Note The status code 200 indicates that the call was successful.
|
Total | Integer | 2 |
The total number of returned entries. |
Resources | Array of Resource |
The resources to which the alert rule is applied. |
|
Resource | |||
Dimensions | String | {\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\",\"userId\":\"120886317861****\"} |
The dimensions that specify the resources whose metric data you want to query. |
Enable | String | true |
Indicates whether the alert rule is enabled. Valid values:
|
Escalation | Array of Resource |
The alert rule based on which the alert is triggered. |
|
Resource | |||
ComparisonOperator | String |
The operator that is used to compare the specified value with the threshold. Valid values:
|
|
Expression | String | $Average>=10 |
The description of the alert rule. Note The content of the alert rule. This parameter indicates the conditions that trigger
an alert.
|
ExpressionList | Array of ExpressionList |
The description of the multi-metric alert rule. |
|
ExpressionList | |||
ComparisonOperator | String |
The operator that is used to compare the specified value with the threshold of the alert level. Valid values:
|
|
MetricName | String |
The name of the metric. |
|
Period | String |
The statistical period of the metric. Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected. |
|
Statistics | String |
The statistical method of the alert level. Valid values:
|
|
Threshold | String |
The alert threshold. |
|
ExpressionListJoin | String | && |
The relationship between multiple metrics. Valid values:
|
Level | Integer | 3 |
The severity level and notification method of the alert. Valid values:
|
PreCondition | String | >= |
The operator that is used to compare the specified value with the threshold. Valid values:
|
Tag | String | mns |
The tags of the resource. |
Threshold | String | 10 |
The alert threshold. |
Times | Integer | 1 |
The consecutive number of times for which the metric value is measured before an alert is triggered. |
GroupId | String | 7671**** |
The ID of the application group. Note If the alert rule is associated with an application group, the ID of the application
group is returned in this parameter.
|
LastAlertTime | String | 1622427900000 |
The timestamp when the last alert was triggered for the resource based on the alert rule. Unit: milliseconds. |
LastModifyTime | String | 1622827900000 |
The timestamp when the alert rule was last modified. Unit: milliseconds. |
Level | Integer | 3 |
The severity level and notification method of the alert. Valid values:
|
MetricName | String | ActiveMessages |
The name of the metric. |
MetricValues | String | {\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"} |
The metric value that triggered the alert based on the alert rule. The value is a JSON string. |
Namespace | String | acs_mns_new |
The namespace of the cloud service. |
ProductCategory | String | mns |
The type of the cloud service. |
Resource | String | userId=120886317861****,region=cn-huhehaote,queue=test-0128 |
The resources that are monitored. |
RetryTimes | String | 3 |
The consecutive number of times for which the metric value is measured before an alert is triggered. |
RuleId | String | putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108**** |
The ID of the alert rule. |
RuleName | String | test123456789 |
The name of the alert rule. |
StartTime | String | 1622427900000 |
The time when the resource was associated with the alert rule. Unit: milliseconds. |
Statistics | String |
The method used to calculate metric values that trigger alerts. |
|
Threshold | String | 10 |
The alert threshold. |
Message | String |
The error message. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeAlertingMetricRuleResources
&<Common request parameters>
Sample success responses
XML
format
<DescribeAlertingMetricRuleResourcesResponse>
<RequestId>0724011B-D9E0-4B2F-8C51-F17A894CC42C</RequestId>
<Total>2</Total>
<Resources>
<Resource>
<RuleId>putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****</RuleId>
<Escalation>
<Resource>
<Expression>$Average>=10</Expression>
<Times>1</Times>
<Level>3</Level>
<Tag>mns</Tag>
</Resource>
</Escalation>
<Resource>userId=120886317861****,region=cn-huhehaote,queue=test-0128</Resource>
<StartTime>1622427900000</StartTime>
<Dimensions>{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}</Dimensions>
<MetricValues>{\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}</MetricValues>
<LastModifyTime>1623727904000</LastModifyTime>
<Statistics>Average</Statistics>
<Namespace>acs_mns_new</Namespace>
<GroupId>7671****</GroupId>
<MetricName>ActiveMessages</MetricName>
<LastAlertTime>1622427900000</LastAlertTime>
<ProductCategory>mns</ProductCategory>
<Enable>true</Enable>
<Level>3</Level>
<RuleName>test123456789</RuleName>
<RetryTimes>1</RetryTimes>
<Threshold>10</Threshold>
</Resource>
<Resource>
<RuleId>putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****</RuleId>
<Escalation>
<Resource>
<Expression>$Average>=10</Expression>
<Times>1</Times>
<Level>3</Level>
<Tag>mns</Tag>
</Resource>
</Escalation>
<Resource>userId=120886317861****,region=cn-huhehaote,queue=test-022401-1</Resource>
<StartTime>1622427900000</StartTime>
<Dimensions>{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-022401-1\"}</Dimensions>
<MetricValues>{\"timestamp\":1623727500000,\"queue\":\"test-022401-1\",\"Maximum\":349,\"Minimum\":349,\"Sum\":698,\"value\":349,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"Average\":349,\"SampleCount\":2}</MetricValues>
<LastModifyTime>1623727904000</LastModifyTime>
<Statistics>Average</Statistics>
<Namespace>acs_mns_new</Namespace>
<GroupId>7671****</GroupId>
<MetricName>ActiveMessages</MetricName>
<LastAlertTime>1622427900000</LastAlertTime>
<ProductCategory>mns</ProductCategory>
<Enable>true</Enable>
<Level>3</Level>
<RuleName>test123456789</RuleName>
<RetryTimes>1</RetryTimes>
<Threshold>10</Threshold>
</Resource>
</Resources>
<Success>true</Success>
</DescribeAlertingMetricRuleResourcesResponse>
JSON
format
{
"RequestId": "0724011B-D9E0-4B2F-8C51-F17A894CC42C",
"Total": 2,
"Resources": {
"Resource": [
{
"RuleId": "putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****",
"Escalation": {
"Resource": [
{
"Expression": "$Average>=10",
"Times": 1,
"Level": 3,
"Tag": "mns"
}
]
},
"Resource": "userId=120886317861****,region=cn-huhehaote,queue=test-0128",
"StartTime": 1622427900000,
"Dimensions": "{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}",
"MetricValues": "{\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}",
"LastModifyTime": 1623727904000,
"Statistics": "Average",
"Namespace": "acs_mns_new",
"GroupId": "7671****",
"MetricName": "ActiveMessages",
"LastAlertTime": 1622427900000,
"ProductCategory": "mns",
"Enable": true,
"Level": 3,
"RuleName": "test123456789",
"RetryTimes": 1,
"Threshold": "10"
},
{
"RuleId": "putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****",
"Escalation": {
"Resource": [
{
"Expression": "$Average>=10",
"Times": 1,
"Level": 3,
"Tag": "mns"
}
]
},
"Resource": "userId=120886317861****,region=cn-huhehaote,queue=test-022401-1",
"StartTime": 1622427900000,
"Dimensions": "{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-022401-1\"}",
"MetricValues": "{\"timestamp\":1623727500000,\"queue\":\"test-022401-1\",\"Maximum\":349,\"Minimum\":349,\"Sum\":698,\"value\":349,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"Average\":349,\"SampleCount\":2}",
"LastModifyTime": 1623727904000,
"Statistics": "Average",
"Namespace": "acs_mns_new",
"GroupId": "7671****",
"MetricName": "ActiveMessages",
"LastAlertTime": 1622427900000,
"ProductCategory": "mns",
"Enable": true,
"Level": 3,
"RuleName": "test123456789",
"RetryTimes": 1,
"Threshold": "10"
}
]
},
}
Error codes
For a list of error codes, visit the API Error Center.