Create an alert template

更新时间:
复制 MD 格式

Alert templates let you save alert rules for multiple cloud services and reuse them across application groups, eliminating repetitive configuration.

Background

  • Alert templates work with application groups. Create an application group first, then apply an alert template to simplify rule management. Create an application group.

  • Limits:

    • Up to 100 alert templates per Alibaba Cloud account.

    • Up to 30 metrics per template.

Procedure

  1. Log on to the Cloud Monitor console.

  2. In the left-side navigation pane, choose Alerts > Alert Templates.

  3. On the Alert Templates page, click Create Alert Template.

  4. In the Create Alert Template panel, enter a name for the template and select the target cloud service.

  5. Click Add Rule under the cloud service to configure the alert rules for the template.

    Cloud Monitor supports these alert template types:

    • Threshold-based alert template

      Parameters for threshold-based alert rules:

      Parameter

      Description

      Rule name

      The threshold-based alert rule name.

      Metric type

      Valid values:

      • Single Metric: Monitors one metric.

      • Multiple Metrics: Monitors multiple metrics.

      Metric name

      The metric to monitor. Supported metrics are listed in Metrics for cloud services.

      Note

      Available only when Metric Type is Single Metric.

      Threshold and alert level

      The alert level and threshold.

      Notification methods by alert level:

      • Critical: Phone, SMS, email, and webhook.

      • Warning: SMS, email, and webhook.

      • Info: Email and webhook.

      Specify the number of consecutive periods a metric must meet the threshold to trigger an alert. Valid values: 1, 3, 5, 10, 15, 30, 60, 70, 90, 120, and 180.

      You can set multiple alert levels. Cloud Monitor sends notifications through different channels based on the triggered level.

      Note

      Available only when Metric Type is Single Metric.

      Alert level

      The alert level and notification method. Valid values:

      • Critical: Phone, SMS, email, and webhook

      • Warning: SMS, email, and webhook

      • Info: Email and webhook

      Note

      Available only when Metric Type is Multiple Metrics.

      Metric type

      The method for creating multi-metric rules. Valid values:

      • Standard Creation: Select metrics and conditions from the console.

      • Expression-based Creation: Define metrics and conditions using an expression.

      Note

      Available only when Metric Type is Multiple Metrics.

      Multi-metric alert description

      The multi-metric alert rule definition.

      Note

      Available only when Metric Type is Multiple Metrics and Standard Creation is selected.

      Relationship between metrics

      How metrics are evaluated together. Valid values:

      • Generate alerts if all metrics meet the conditions (&&)

      • Generate alerts if any condition is met (||)

      Note

      Available only when Metric Type is Multiple Metrics and Standard Creation is selected.

      Multi-metric alert expression

      The multi-metric alert expression.

      Configure expressions as described in Alert rule expressions.

      Note

      Available only when Metric Type is Multiple Metrics and Expression-based Creation is selected.

      Number of times the threshold must be reached before an alert is triggered

      Consecutive periods a metric must meet the threshold to trigger an alert. Valid values: 1, 3, 5, 10, 15, 30, 60, 70, 90, 120, and 180.

      Method to handle alerts when no monitoring data is found

      Action when monitoring data is unavailable. Valid values:

      • Do not do anything

      • Send alert notifications

      • Mark as recovered

      Tag

      Tags for the template. Tags are automatically included in alert content.

      Alert callback

      A publicly accessible URL that receives alert notifications via HTTP POST requests. Use alert callbacks for threshold-based alerts.

      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.

    • Event-triggered alert template

      Event-triggered alert rules support only system events. Parameters:

      Parameter

      Description

      Rule name

      The event-triggered alert rule name.

      Event type

      The event type. Supported types are listed in System events for cloud services.

      Event Level

      The event severity level. Supported levels are listed in System events for cloud services.

      Event name

      The event name. Supported events are listed in System events for cloud services.

      Notification method

      Notification method. Valid values:

      • Alert Notification: Select a notification method. Valid values:

        • Critical (Phone, SMS, email, Wangwang, and DingTalk Chatbot)

        • Warning (SMS, email, Wangwang, and DingTalk Chatbot)

        • Info (Email, Wangwang, and DingTalk Chatbot)

      • Simple Message Queue (SMQ): Delivers alerts to a specified SMQ queue.

      • Function Compute: Delivers alerts to a specified function.

      • URL Callback: A publicly accessible URL that receives alerts via HTTP POST requests. Use alert callbacks for system events (legacy).

      • Simple Log Service: Delivers alerts to a specified Logstore.

    • Group process alert template

      Only ECS supports group process alerts. Parameters:

      Parameter

      Description

      Process name

      The process alert rule name.

      Matching rule

      How processes are matched. Valid values:

      • All Instances: Applies to all instances in the group. An alert triggers when any process on any instance meets the condition.

      • All Rules: Triggers when processes on an instance meet all rules.

      • Any Rule: Triggers when processes on an instance meet any rule.

      Match expression

      A dynamic rule for matching processes. Apply to all instances or only instances with a specific name pattern.

      Note

      Required only when Matching Rule is All Rules or Any Rule.

      Number of processes

      The process count threshold.

    • Availability monitoring alert template

      Only ECS supports availability monitoring alerts. Parameters:

      Parameter

      Description

      DtsJobName

      The availability monitoring task name.

      Detection type

      The detection target type. Valid values:

      • HTTP(S): Enter the target URL.

      • TELNET: Enter the target IP address.

      • PING: Enter the target IP address.

      Detection address

      The URL or IP address for the selected detection type.

      Request method

      The HTTP probe method. Valid values:

      • HEAD

      • GET

      • POST

      Match response content

      Response content matching criteria.

      The probe reads the first 64 KB of the response body and matches against the specified content. Methods:

      • Generate Alerts If Response Contains

      • Generate Alerts If Response Does Not Contain

      Note

      Required only when Detection Type is HTTP(S).

      Status code

      Triggers an alert when the probe status code matches the condition.

      An alert triggers if either Status Code or Response Time reaches its threshold, and is sent to the application group's contact group.

      Response time

      Triggers an alert when the probe response time meets the condition.

      An alert triggers if either Status Code or Response Time reaches its threshold, and is sent to the application group's contact group.

  6. Click OK.

  7. Click OK.

  8. In the Create/Modify Alert Template Complete dialog box, click OK.

    Note

    If you click Cancel, the template is not applied to the group. Apply it later from Apply an alert template to an application group.

  9. In the Apply Template to Group dialog box, set application group, mute period, effective period, alert callback, and Template Application Method.

  10. Click OK.

  11. In the Apply Template to Group dialog box, click OK.