Configure alert rules

更新时间:
复制 MD 格式

You can create alert rules to monitor the usage of your CDN domain names. If a resource's metric meets the specified alert condition, CloudMonitor automatically sends an alert notification. This ensures you are promptly notified of abnormal monitoring data, allowing you to resolve issues quickly.

Prerequisites

Procedure

  1. Go to the CloudMonitor console.

    • Method 1: Log on to the CloudMonitor console.

    • Method 2:

      1. Log on to the CDN console.

      2. In the left navigation pane, click Domain Names.

      3. On the Domain Names page, click Monitor and Alert Settings in the upper-right corner to open the CloudMonitor console.

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

  3. On the Cloud Service Monitoring page, find and click CDN.

  4. Click Create alert rule.

  5. In the Create alert rule panel, configure the parameters in the following table and leave the others at their default values. For more information about other parameters, see Create an alert rule.

    Parameter

    Description

    Product

    Select CDN.

    Resource Range

    The scope of resources to which the alert rule applies. Valid values:

    • All Resources: The alert rule applies to all CDN domain names, including domain names that are added after the rule is created.

    • Application Group: The alert rule applies to all domain names within a specified application group, including domain names that are added after the rule is created.

    • Instance: The alert rule applies to one or more specified CDN domain names.

    Rule Description

    The content of the alert rule. The parameters in this section specify the conditions that trigger an alert. To specify the rule description, perform the following steps:

    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.

      • 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.

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

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

    Note

    For more information about how to specify complex alert conditions, see Alert rule expressions.

    Mute For

    The interval at which CloudMonitor resends alert notifications before an alert is cleared. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours.

    If a metric value reaches the threshold, CloudMonitor sends an alert notification. If the metric value reaches the threshold again within the mute period, CloudMonitor does not resend an alert notification. If the alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.

    For example, if the Mute For parameter is set to 12 Hours and the alert is not cleared, CloudMonitor resends an alert notification after 12 hours.

    Effective At

    The period during which the alert rule is effective. CloudMonitor sends alert notifications based on the alert rule only within the effective period.

    Note

    If an alert rule is not effective, no alert notification is sent. However, the alert history is still displayed on the Alert History page.

    Alert Contact Group

    The alert contact groups to which alert notifications are sent.

    The alert notifications of the application group are sent to the alert contacts that belong to the selected alert contact groups. An alert contact group can contain one or more alert contacts.

    For more information about how to create an alert contact and an alert contact group, see Create an alert contact or an alert contact group.

    Tags

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

    Note

    You can add up to six tags.

  6. Click OK.

Alert rule configuration examples

The following examples show how to configure alert rules for your CDN domain names to ensure you are promptly notified of abnormal metrics and can resolve issues quickly.

Single metric

For example, you can configure a rule to trigger a Emergency alert when the minimum value of outbound traffic for a specified domain name is 500 MB or greater for three consecutive periods, and a Warn alert when the maximum value is 300 MB or greater for three consecutive periods. The following settings for Resource Range and Rule Description are recommended.

  • Resource Range: Instance.

  • Associated Resources: Select the target domain name example.aliyundoc.com.

    In the Resource Range section, click the Instance tab.

  • Rule Description

    The notification methods vary by alert level: Critical alerts are sent by phone call, SMS, email, and webhook; Warn alerts by SMS, email, and webhook; and Info alerts by email and webhook.

    Parameter

    Example value

    Metric type

    Simple Metrics

    Metric

    Instance-level > Downstream Traffic

    Thresholds and alert levels

    • For all alert levels, set the period to 3 consecutive periods (1 period = 1 minute).

    • Alert Level: Emergency, minimum value is 500 MB or greater.

    • Alert Level: Warn, maximum value is 300 MB or greater.

    • Alert Level: Info, average value is 100 MB or greater.

Multiple metrics

For example, you can trigger a Warn alert if the maximum value of outbound traffic for a specified domain name is 300 Mbps or greater, OR the maximum value of the origin 502 status code ratio is 1% or greater, for three consecutive periods. The following settings for Resource Range and Rule Description are recommended.

  • Resource Range: Instances.

  • Associated Resources: Select example.aliyundoc.com.

    image

  • Rule Description

    Parameter

    Example value

    Metric type

    Composite Metrics

    Alert level

    Warn

    Metric type

    Standard

    Multi-metric alert description

    1. Click Add Metric, and select Instance-level > Downstream Traffic from the Metric drop-down list.

    2. Set the maximum value to 300 Mbps or greater.

    3. Repeat the preceding steps to add the Instance-level > Origin 502 Status Code Ratio metric, and set its maximum value to 1% or greater.

    Note

    For more information about how to specify complex alert conditions, see Alert rule expressions.

    Relationship between metrics

    Trigger alert if one of the conditions is met (||)

    Number of consecutive times the threshold must be met

    3 consecutive periods (1 period = 1 minute)