All Products
Search
Document Center

Cloud Monitor:DescribeAlertingMetricRuleResources

Last Updated:Jul 21, 2026

Queries the list of resources that are triggering alerts for a specified alert rule.

Operation description

This topic provides an example to show how to set a threshold-based alert rule for the metric cpu_total of the Elastic Compute Service (ECS) instance i-uf6j91r34rnwawoo**** in the acs_ecs_dashboard namespace. The alert contact group is ECS_Group, the alert rule name is test123, the alert rule ID is a151cd6023eacee2f0978e03863cc1697c89508****, the statistical method for the Critical level is Average, the comparison operator for the Critical level is GreaterThanOrEqualToThreshold, the threshold for the Critical level is 90, and the retry count for the Critical level is 3.

Note

On August 15, 2024, Statistics validation was increased. The statistical value must correspond to the Statistics of the metric. For more information about how to obtain the value of this parameter, see Alibaba Cloud service monitoring metrics.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:DescribeAlertingMetricRuleResources

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RuleId

string

No

The ID of the alert rule. For more information about how to query alert rule IDs, see DescribeMetricRuleList.

putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****

GroupId

string

No

The ID of the application group. For more information about how to query application group IDs, see DescribeMonitorGroups.

7671****

Page

integer

No

The page number.

Default value: 1.

1

PageSize

integer

No

The number of entries per page.

Default value: 10.

10

Namespace

string

No

The data namespace of the Alibaba Cloud service.

For more information about how to obtain the data namespace of an Alibaba Cloud service, see Alibaba Cloud service monitoring metrics.

acs_mns_new

Dimensions

string

No

The dimension map used to query monitoring data of a specified resource.

{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}

AlertBeforeTime

string

No

Queries alerts that occurred before this point in time. The value is a millisecond-level timestamp.

1698827400000

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

None.

Code

integer

The status code.

Note

A value of 200 indicates success.

200

Message

string

The error message.

The request processing has failed due to some unknown error.

RequestId

string

The request ID.

0724011B-D9E0-4B2F-8C51-F17A894CC42C

Total

integer

The total number of records.

2

Success

boolean

Indicates whether the operation was successful. Valid values:

  • true: The operation was successful.

  • false: The operation failed.

true

Resources

object

Resource

array<object>

The list of resources associated with the alert rule.

array<object>

None.

MetricName

string

The metric name.

ActiveMessages

RetryTimes

string

The number of alert retries.

3

MetricValues

string

The metric values when the alert was triggered. The value is a JSON string.

{\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}

Namespace

string

The namespace of the cloud service.

acs_mns_new

RuleName

string

The alert rule name.

test123456789

RuleId

string

The alert rule ID.

putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****

ProductCategory

string

The cloud service type.

mns

StartTime

string

The timestamp when the resource was associated with the alert rule.

Unit: milliseconds.

1622427900000

Resource

string

The resource that triggered the alert.

userId=120886317861****,region=cn-huhehaote,queue=test-0128

LastModifyTime

string

The timestamp when the alert rule was last modified.

Unit: milliseconds.

1622827900000

GroupId

string

The application group ID.

Note

If the alert rule is associated with a specified application group, this application group ID is displayed.

7671****

Dimensions

string

The dimension map used to query monitoring data for a specified resource.

{\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\",\"userId\":\"120886317861****\"}

LastAlertTime

string

The timestamp when the alert was last triggered.

Unit: milliseconds.

1622427900000

Level

integer

The alert level and notification method. Valid values:

  • 4: email + DingTalk chatbot.

  • OK: no alert.

3

Threshold

string

The alert threshold.

10

Statistics

string

The statistical method for the alert.

Average

Enable

string

Indicates whether the alert rule is enabled. Valid values:

  • true: The alert rule is enabled.

  • false: The alert rule is disabled.

true

Escalation

object

Resource

array<object>

The rule that triggered the alert.

array<object>

None.

ComparisonOperator

string

The threshold comparison operator. Valid values:

  • GreaterThanOrEqualToThreshold: greater than or equal to

  • GreaterThanThreshold: greater than

  • LessThanOrEqualToThreshold: less than or equal to

  • LessThanThreshold: less than

  • NotEqualToThreshold: not equal to

  • GreaterThanYesterday: increased compared with the same time yesterday

  • LessThanYesterday: decreased compared with the same time yesterday

  • GreaterThanLastWeek: increased compared with the same time last week

  • LessThanLastWeek: decreased compared with the same time last week

  • GreaterThanLastPeriod: increased compared with the previous period

  • LessThanLastPeriod: decreased compared with the previous period

GreaterThanOrEqualToThreshold

PreCondition

string

The threshold comparison symbol. Valid values:

  • >=

  • =

  • <=

  • >

  • <

  • !=

>=

Expression

string

The description of the rule that triggered the alert.

Note

This is the body of the alert rule. When monitoring data meets the alert condition, the alert rule is triggered.

$Average>=10

Times

integer

The number of alert retries.

1

Tag

string

This parameter is deprecated and can be ignored.

Deprecated: true

Threshold

string

The alert threshold.

10

Level

integer

The alert level and notification method. Valid values:

  • 4: email + DingTalk chatbot.

  • OK: no alert.

3

ExpressionListJoin

string

The relationship between multiple metrics. Valid values:

  • &&: An alert notification is sent only when all metrics meet the alert conditions.

  • ||: An alert notification is sent when any metric meets the alert conditions.

&&

ExpressionList

object

ExpressionList

array<object>

The description of the multi-metric alert rule.

object

None.

ComparisonOperator

string

The threshold comparison operator for the alert level. Valid values:

  • GreaterThanOrEqualToThreshold: greater than or equal to

  • GreaterThanThreshold: greater than

  • LessThanOrEqualToThreshold: less than or equal to

  • LessThanThreshold: less than

  • NotEqualToThreshold: not equal to

  • GreaterThanYesterday: increased compared with the same time yesterday

  • LessThanYesterday: decreased compared with the same time yesterday

  • GreaterThanLastWeek: increased compared with the same time last week

  • LessThanLastWeek: decreased compared with the same time last week

  • GreaterThanLastPeriod: increased compared with the previous period

  • LessThanLastPeriod: decreased compared with the previous period

GreaterThanOrEqualToThreshold

MetricName

string

The metric name.

cpu_total

Period

string

The statistical period of the metric. Unit: seconds. The default value is the original reporting period of the metric.

60

Statistics

string

The statistical method for the alert level. Valid values:

  • Maximum: maximum value

  • Minimum: minimum value

  • Average: average value

Average

Threshold

string

The alert threshold.

90

ExpressionRaw

string

The alert condition created by using an expression. The following scenarios are supported but not limited to:

  • Set an alert blacklist for specific resources. For example, $instanceId != 'i-io8kfvcpp7x5****' ``&&`` $Average > 50 specifies that no alert is triggered for instance i-io8kfvcpp7x5**** even if its Average exceeds 50.

  • Set a special alert threshold for a specific instance in the rule. For example, $Average > ($instanceId == 'i-io8kfvcpp7x5****'? 80: 50) specifies that an alert is triggered for instance i-io8kfvcpp7x5**** only when its Average exceeds 80, while an alert is triggered for other instances when their Average exceeds 50.

  • Limit the number of instances that exceed the threshold. For example, count($Average > 20) > 3 specifies that an alert is triggered only when more than three instances in the alert rule have an Average greater than 20.

$Average > ($instanceId == 'i-io8kfvcpp7x5****'? 80: 50)

Examples

Success response

JSON format

{
  "Code": 200,
  "Message": "The request processing has failed due to some unknown error.",
  "RequestId": "0724011B-D9E0-4B2F-8C51-F17A894CC42C",
  "Total": 2,
  "Success": true,
  "Resources": {
    "Resource": [
      {
        "MetricName": "ActiveMessages",
        "RetryTimes": "3",
        "MetricValues": "{\\\"timestamp\\\":1623727500000,\\\"Sum\\\":926,\\\"value\\\":463,\\\"Maximum\\\":463,\\\"Minimum\\\":463,\\\"Average\\\":463,\\\"SampleCount\\\":2,\\\"userId\\\":\\\"120886317861****\\\",\\\"region\\\":\\\"cn-huhehaote\\\",\\\"queue\\\":\\\"test-0128\\\"}",
        "Namespace": "acs_mns_new",
        "RuleName": "test123456789",
        "RuleId": "putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****",
        "ProductCategory": "mns",
        "StartTime": "1622427900000",
        "Resource": "userId=120886317861****,region=cn-huhehaote,queue=test-0128",
        "LastModifyTime": "1622827900000",
        "GroupId": "7671****",
        "Dimensions": "{\\\"region\\\":\\\"cn-huhehaote\\\",\\\"queue\\\":\\\"test-0128\\\",\\\"userId\\\":\\\"120886317861****\\\"}",
        "LastAlertTime": "1622427900000",
        "Level": 3,
        "Threshold": "10",
        "Statistics": "Average",
        "Enable": "true",
        "Escalation": {
          "Resource": [
            {
              "ComparisonOperator": "GreaterThanOrEqualToThreshold",
              "PreCondition": ">=",
              "Expression": "$Average>=10",
              "Times": 1,
              "Tag": "Deprecated: true",
              "Threshold": "10",
              "Level": 3,
              "ExpressionListJoin": "&&",
              "ExpressionList": {
                "ExpressionList": [
                  {
                    "ComparisonOperator": "GreaterThanOrEqualToThreshold",
                    "MetricName": "cpu_total",
                    "Period": "60",
                    "Statistics": "Average",
                    "Threshold": "90"
                  }
                ]
              },
              "ExpressionRaw": "$Average > ($instanceId == 'i-io8kfvcpp7x5****'? 80: 50)"
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 %s %s
500 %s %s
500 InternalError The request processing has failed due to some unknown error.
403 %s %s
404 %s %s
503 %s %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.