Set an alert template

更新时间:
复制 MD 格式

Alert templates let you save a set of alert rules once and reuse them across multiple AnalyticDB for PostgreSQL instances. Instead of reconfiguring the same rules for each instance, apply a template to an application group and CloudMonitor creates the rules automatically.

Prerequisites

Before you begin, ensure that you have:

Limits

  • Each Alibaba Cloud account supports up to 100 alert templates.

  • Each alert template supports up to 30 metrics.

  • Using CloudMonitor may incur fees. For more information, see CloudMonitor Pricing.

Create an alert template

The workflow has three stages: create the template with alert rules, confirm the template, then apply it to an application group to activate the rules.

  1. Log on to the CloudMonitor 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 cloud service to monitor.

  5. Click Add Rule and configure the alert rule. CloudMonitor supports two template types: Configure the parameters based on the template type you selected. Event template parameters Event-triggered alert rules support system events only.

    • Metric template: Threshold-triggered rules that fire when a metric crosses a value.

    • Event template: Event-triggered rules that fire on system events.

    Metric template parameters

    Parameter Description
    Rule Name Name of the threshold-triggered alert rule.
    Metric Type Scope of the rule. Single Metric monitors one metric. Multiple Metrics monitors multiple metrics together.
    Metric Name The metric to monitor. For available metrics, see Appendix 1: Metrics. Applies only when Metric Type is set to Single Metric.
    Threshold and Alert Level Alert level and its threshold. For the Info level, notifications are sent via Email + Webhook. Also specify how many consecutive cycles the metric must exceed the threshold before an alert fires. Valid values: 1, 3, 5, 10, 15, 30, 60, 70, 90, 120, or 180 consecutive cycles. Applies only when Metric Type is set to Single Metric.
    Alert Level For multiple metrics rules, the alert level and notification method. Info sends via Email + Webhook. Applies only when Metric Type is set to Multiple Metrics.
    Metric Type How to specify multiple metrics and their conditions. Standard Creation lets you select metrics and specify conditions using a form. Expression-based Creation lets you write an expression directly. Applies only when Metric Type is set to Multiple Metrics.
    Multi-metric Alert Expression The alert expression for multiple metrics. Applies only when Metric Type is set to Multiple Metrics and the creation method is set to Standard Creation.
    Relationship Between Metrics How multiple metric conditions are evaluated. Generate alerts if all metrics meet the conditions (&&) requires all conditions to be true. Generate alerts if one of the conditions is met (||) fires when any one condition is true. Applies only when Metric Type is set to Multiple Metrics and the creation method is set to Standard Creation.
    Multi-metric Alert Expression (expression-based) The expression that defines multiple metrics and conditions. For expression syntax, see Alert rule expressions. Applies only when Metric Type is set to Multiple Metrics and the creation method is set to Expression-based Creation.
    Select the number of times the threshold is reached before an alert is triggered The number of consecutive cycles the metric must satisfy the condition before CloudMonitor sends a notification. Valid values: 1, 3, 5, 10, 15, 30, 60, 70, 90, 120, or 180 consecutive cycles.
    Method to handle alerts when no monitoring data is found What CloudMonitor does when a metric has no data. Options: Do not do anything, Send alert notifications, or Treated as normal.
    Tag Tags added automatically to the alert content.
    Alert Callback The callback URL that CloudMonitor calls via HTTP POST when an alert fires. You can enter only an HTTP URL. To test the URL, click Test next to the field, configure Test Template Type and Language in the Webhook Test panel, then click Test. Click Close when done. For setup details, see Use the alert callback feature to send notifications about threshold-triggered alerts.
    Parameter Description
    Rule Name Name of the event-triggered alert rule.
    Event Type The type of event that triggers alerts. For supported event types per Alibaba Cloud service, see Appendix 2: System events.
    Event Level The severity level of the triggering event. For supported severity levels per service, see Appendix 2: System events.
    Event Name The name of the triggering event. For supported event names per service, see Appendix 2: System events.
    Notification Method Where CloudMonitor delivers the event alert. Options: Message Service - Queue (an MNS queue), Function Compute (a Function Compute function), URL Callback (an HTTP POST to a callback URL — you can enter only an HTTP URL; see Configure callbacks for system event-triggered alerts), or Log Service (a Log Service Logstore).
  6. Click OK.

  7. Click OK.

  8. In the Alert Template Created/Modified message, click Confirm.

    Clicking Cancel creates the template without applying it. To apply the template later, see Apply alert templates to application groups.
  9. In the Apply Templates to Groups dialog box, select one or more application groups and set the Mute For, Effective From, Alert Callback, and Priority parameters.

  10. Click Confirm.

  11. In the Apply Templates to Groups message, click Confirm.

What's next