Create an alert rule

Updated at:

You can create alert rules to monitor cloud resources in an application group. When resource metrics meet the specified alert conditions, Cloud Monitor automatically sends notifications to help you promptly identify and handle exceptions.

Procedure

  1. Log on to the Cloud Monitor console.

  2. In the left-side navigation pane, choose Cloud Resource Monitoring > Application Groups.

  3. On the Application Groups tab, click the name of the application group.

  4. In the left-side navigation pane, click Alert Rules.

  5. Click Create Alert Rule.

  6. In the Create Alert Rule panel, configure the parameters. The following table describes the parameters.

    Parameter

    Description

    Product

    An Alibaba Cloud service monitored by Cloud Monitor. Example: ApsaraDB RDS.

    Resource Range

    Scope of resources for this alert rule. Valid values:

    • All Resources: Applies to all resources of the specified product, including resources added later.

    • Application Groups: Applies to all resources in the specified application group of the selected product, including resources added later.

    • Instances: Applies to the specified resource of the selected product only.

    Rule Description

    Defines when Cloud Monitor triggers an alert. To configure:

    1. Click Add Rule and select a metric type.

    2. In the Configure Rule Description panel, enter a Alert Rule, then define the rule conditions.

      • Simple Metric: Select a metric, then set its threshold and alert level.

        Alert levels use an escalations model. When the threshold reaches a specific level, only that level is triggered; other levels are not triggered simultaneously. For example, if the threshold directly reaches Critical, only the Critical alert is triggered, and the Info and Warning alerts are not triggered at the same time.

      • Combined Metrics: Select an alert level, then define an alert condition using two or more metrics.

        Note

        Multi-metric alert rules require the target resource to report data for every included metric. For example, if the rule includes a public network metric but the ECS instance has no public IP address, the alert does not trigger.

        By default, a multi-metric alert rule triggers an alert only when all metrics meet their conditions. This means every metric must reach its threshold at the same time. To trigger an alert when any one metric reaches its threshold, change the metric relationship to the option that triggers on any satisfied condition.

      • Expression: Select an alert level, then define an alert expression.

      • Dynamic Threshold: Smart threshold details: Overview | Create a smart threshold alert rule.

    The alert level determines the notification method used when an alert occurs. Only the Critical level supports phone call notifications. The Warning and Info levels do not support phone call notifications. The following table lists the notification methods supported by each alert level.

    Alert level

    Notification method

    Critical (Critical)

    Phone call + text message + email + Webhook

    Warning (Warn)

    Text message + email + Webhook

    Info (Info)

    Email + Webhook

    Note

    Complex alert expressions: Alert rule expression reference.

    Mute Period

    Interval between repeated alert notifications when an alert remains active and unacknowledged. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours.

    When a metric crosses its alert threshold, Cloud Monitor sends an alert. No additional alerts are sent during the mute period. After the mute period ends, if the metric still exceeds the threshold, Cloud Monitor sends another alert.

    For example, if you set the Mute Period to 12 hours and the alert remains active, Cloud Monitor sends another alert 12 hours later.

    Effective Period

    The time range during which the alert rule is active. Alerts are sent only during this period.

    Note

    Outside the effective period, alerts are not sent, but alert history records still appear in the alert history list.

    Alert Contact Group

    The group of contacts who receive alert notifications.

    An alert contact group contains one or more alert contacts. Notifications for an application group are sent to all contacts in this group.

    To create contacts or groups, see Create an alert contact or alert contact group.

    Phone calls are sent by default for Critical (Critical) alert notifications. To turn off phone calls, select the warning level Warning (Warn) or Info (Info), or remove the contacts who receive phone calls from the alert contact group. The notification method for Warning (Warn) is text message, email, and Webhook. The notification method for Info (Info) is email and Webhook.

    Alert rules do not support custom notification content or templates. To use custom notification templates with multiple channels (such as DingTalk, Feishu/Lark, and email) and variable-based content, use the notification template management feature of Cloud Monitor 2.0. In the Cloud Monitor console, choose Alert Center > Notification Management > Notification Templates.

    Tag

    A tag for the alert rule. Each tag has a name and a value.

    Note

    You can add up to six tags.

    Alert Callback

    A publicly accessible URL that receives alert data from Cloud Monitor via HTTP POST requests. Only HTTP is supported. Use threshold-based alert callbacks.

    To test connectivity to the callback URL:

    1. Click Test, located directly to the right of the callback URL.

      In the WebHook Test panel, check the HTTP status code and test result details to verify connectivity.

      Note

      You can also set the Test Template Type: and Language:. Then click Test again to view updated test results.

    2. Click Close.

    Note

    Click Advanced Settings to configure this parameter.

    Auto Scaling

    If you enable Auto Scaling, Cloud Monitor triggers the associated scaling rule when an alert occurs. You must specify the Region, ESS Group, and ESS Rule.

    Note

    Click Advanced Settings to configure this parameter.

    Simple Log Service

    If you enable Simple Log Service, Cloud Monitor sends alert data to a Logstore in Simple Log Service (SLS) when an alert occurs. You must specify the Region, ProjectName, and Logstore.

    Note

    Click Advanced Settings to configure this parameter.

    Simple Message Queue (formerly MNS) - Topic

    If you enable Simple Message Queue (formerly MNS) - Topic, Cloud Monitor sends alert data to a Message Service (MNS) topic when an alert occurs. You must specify the region and topic.

    Note

    Click Advanced Settings to configure this parameter.

    Function Compute

    If you enable Function Compute, Cloud Monitor sends alert notifications to Function Compute (FC) for custom formatting when an alert occurs. You must specify the region, service, and function.

    Note

    Click Advanced Settings to configure this parameter.

    Method to handle alerts when no monitoring data is found

    How Cloud Monitor handles alerts when no monitoring data is available. Valid values:

    • Do not do anything (default)

    • Send alert notifications

      After you select this option, a no-data alert is triggered when the metric has no data for 10 consecutive collection periods. The default collection period is 1 minute (configurable through the Period parameter), so the alert is triggered about 10 minutes later.

    • Treated as normal

    Note

    Click Advanced Settings to configure this parameter.

  7. Click Confirm.

FAQ

How do I configure urgent phone alerts or low disk space warnings?

  • Phone alerts: When creating an alert rule, set the alert level to Critical. CloudMonitor automatically notifies all members in the linked alert contact group via phone call.

  • Low disk remaining space warning: In the Rule Description section, select the metric that measures remaining disk space (for example, the disk free space metric in GB), and set the threshold to the minimum acceptable value (for example, 5 GB). CloudMonitor sends a text message notification when the remaining space falls below this threshold.

  • Prerequisite: Phone and text message notifications require a correctly configured alert contact group linked to the rule. For details, see Create an alert contact or alert contact group.

Why can't I select instance-level metrics when creating a CLB alert rule?

If you encounter this issue in the current console, use the new CloudMonitor console to create the alert rule:

https://cloudmonitornext.console.aliyun.com/productListNav/acs_slb_dashboard/slb/all

The new console supports selecting instance-level metrics for CLB (Classic Load Balancer, also known as SLB) and configuring alert rules normally.

Why did I not receive alert notifications, or why was the alert not triggered?

If you expected an alert notification but did not receive one, or an alert was not triggered as expected, check the following:

  1. Confirm that an alert rule exists: Verify that a valid alert rule has been created for the target resource (for example, ECS) in the CloudMonitor console. If no rule is configured, no notifications are sent.

  2. Verify the monitoring metric: Check that the configured metric matches your intent. For example, you may have configured Inode Utilization instead of Disk Space Utilization, or a byte-based metric instead of a percentage-based one. Run the appropriate OS-level command to verify actual metric values (for example, df -i for inode usage or df -h for disk space).

  3. Validate the threshold and trigger logic: Confirm that the threshold unit (bytes or percentage) matches the selected metric, and understand that alerts are triggered based on the average value across consecutive collection periods — not on instantaneous values. If the instantaneous value recovers but the rolling average still meets the threshold, the alert continues to trigger.

How do I automate alert-rule configuration if I cannot create an event subscription through OpenAPI?

If you cannot create an event subscription through OpenAPI, use CreateGroupMetricRules to create alert rules for an application group as an alternative solution. This lets you automate alert configuration for the application group.

How do I select or exclude a specific Resource Scope when I create an alert rule?

  • To set a separate threshold for one ECS instance, set Resource Scope to Instance and specify the ECS instance ID.

  • To separate the production environment from the test environment, do not use One-click Alert, which applies to every ECS instance in your account. Create custom alert rules for production instances, and do not create rules for test instances.

  • When special servers need a different threshold than general servers, create multiple independent rules. First, create a general rule with Resource Scope set to All Resources or an application group, such as a threshold of 80%. Then create a separate instance-level rule with Resource Scope set to Instance for each special server, such as a threshold of 90%. If multiple rules meet their trigger conditions, each rule triggers independently; an instance-level rule does not override a general rule.

  • Availability Monitoring does not support adding more than one Alert Contact Group to one rule. Merge the required contacts into one alert contact group, or create identical rules that each link to a different alert contact group.

How do I adjust alert thresholds for different scenarios and avoid missed or false alerts?

  • To prevent an alert when an ECS instance is stopped, set the ECS status condition to > 0. A stopped instance has a metric value of -1, so this condition does not match. If you want every state other than 0 to be treated as an alert condition, set the condition to != 0.

  • CPU or load spikes can be too brief to trigger an alert because Cloud Monitor evaluates the average after sample aggregation. Preview the aggregate data for the target instance while you configure the alert rule, then lower the threshold when the observed aggregate values require it.

  • If a server generates frequent Load Average alerts, raise the threshold as appropriate for the actual workload.

  • To configure a disk usage alert, set the effective scope, configure a threshold such as greater than 90%, link an Alert Contact Group, and make sure that the target server has the Cloud Monitor agent installed.