All Products
Search
Document Center

AnalyticDB for PostgreSQL:Configure an alert template

Last Updated:Oct 20, 2023

You can save the alert rules configured for an AnalyticDB for PostgreSQL instance into an alert template. Then, you can create or modify an alert rule directly by using the alert template instead of repeatedly configuring the alert rule.

Usage notes

  • Alert templates must be used together with application groups. You can create an application group first. Then, you can create an alert template and apply the alert template to the application group to create alert rules for the application group. This simplifies the creation and maintenance of alert rules. For information about how to create an application group, see Create an application group.

  • When you create an alert template, take note of the following limits:

    • You can create up to 100 alert templates within each Alibaba Cloud account.

    • You can specify up to 30 metrics in each alert template.

Create an alert template

  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, specify a name for the template and select the cloud service that you want to monitor.

  5. Click Add Rule below the cloud service that you select to configure an alert rule.

    The following types of alert templates are supported in CloudMonitor:

    • Metric template

      The following tables describe the parameters of a threshold-triggered alert rule.

      Parameter

      Description

      Rule Name

      The name of the threshold-triggered alert rule.

      Metric Type

      The metric type of the threshold-triggered alert rule. Valid values:

      • Single Metric: The alert rule applies to only one metric.

      • Multiple Metrics: The alert rule applies to multiple metrics.

      Metric Name

      The name of the metric that you want to monitor. For information about how to obtain the metrics for an Alibaba Cloud service, see Appendix 1: Metrics.

      Note

      This parameter is displayed only if you set the Metric Type parameter to Single Metric.

      Threshold and Alert Level

      The alert level and the corresponding threshold.

      The notification method for alerts of the Info level is Email + Webhook.

      You also need to select the number of times that the metric to be monitored reaches the alert threshold before an alert notification is sent. Valid values: 1 Consecutive Cycles, 3 Consecutive Cycles, 5 Consecutive Cycles, 10 Consecutive Cycles, 15 Consecutive Cycles, 30 Consecutive Cycles, 60 Consecutive Cycles, 70 Consecutive Cycles, 90 Consecutive Cycles, 120 Consecutive Cycles, and 180 Consecutive Cycles.

      Note

      This parameter is displayed only if you set the Metric Type parameter to Single Metric.

      Alert Level

      The alert level and the corresponding alert notification methods. Valid values:

      Info: Email + Webhook

      Note

      This parameter is displayed only if you set the Metric Type parameter to Multiple Metrics.

      Metric Type

      The method that you want to use to specify metrics and conditions. Valid values:

      • Standard Creation: Select multiple metrics and specify conditions.

      • Expression-based Creation: Enter an expression to specify multiple metrics and conditions.

      Note

      This parameter is displayed only if you set the Metric Type parameter to Multiple Metrics.

      Multi-metric Alert Expression

      The alert rule that is created for multiple metrics.

      Note

      This parameter is displayed only if you set the Metric Type parameter to Multiple Metrics and the Metric Type parameter to Standard Creation.

      Relationship Between Metrics

      The relationship between multiple metrics. Valid values:

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

      • Generate alerts if one of the conditions is met (||)

      Note

      This parameter is displayed only if you set the Metric Type parameter to Multiple Metrics and the Metric Type parameter to Standard Creation.

      Multi-metric Alert Expression

      The expression that is used to specify multiple metrics and conditions.

      For information about how to specify multi-metric alert expressions, see Alert rule expressions.

      Note

      This parameter is displayed only if you set the Metric Type parameter to Multiple Metrics and the Metric Type parameter to Expression-based Creation.

      Select the number of times the threshold is reached before an alert is triggered

      The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications. Valid values: 1 Consecutive Cycles, 3 Consecutive Cycles, 5 Consecutive Cycles, 10 Consecutive Cycles, 15 Consecutive Cycles, 30 Consecutive Cycles, 60 Consecutive Cycles, 70 Consecutive Cycles, 90 Consecutive Cycles, 120 Consecutive Cycles, and 180 Consecutive Cycles.

      Method to handle alerts when no monitoring data is found

      The method that you want to use to handle alerts when no monitoring data is found. Valid values:

      • Do not do anything

      • Send alert notifications

      • Treated as normal

      Tag

      The tags of the alert template. The specified tags are automatically added to the alert content.

      Alert Callback

      The callback URL that can be accessed over the Internet. CloudMonitor sends HTTP POST requests to push alert notifications to the specified URL. You can enter only an HTTP URL. For more information about how to configure alert callback, see Use the alert callback feature to send notifications about threshold-triggered alerts.

      To test the connectivity of an alert callback URL, perform the following steps:

      1. Click Test next to the callback URL.

        In the Webhook Test panel, you can check and troubleshoot the connectivity of the alert callback URL based on the returned status code and test result details.

        Note

        To obtain the details of the test result, configure the Test Template Type and Language parameters and click Test.

      2. Click Close.

    • Event template

      Event-triggered alert rules support only system events. The following table describes the parameters of an event-triggered alert rule.

      Parameter

      Description

      Rule Name

      The name of the event-triggered alert rule.

      Event Type

      The type of the event that triggers alerts. For more information about the types of the events that are supported by each Alibaba Cloud service, see Appendix 2: System events.

      Event Level

      The severity level of the event that triggers alerts. For more information about the severity levels of the events that are supported by each Alibaba Cloud service, see Appendix 2: System events.

      Event Name

      The name of the event that triggers alerts. For more information about the names of the events that are supported by each Alibaba Cloud service, see Appendix 2: System events.

      Notification Method

      The notification method of the event-triggered alert. Valid values:

      • Message Service - Queue: The Message Service (MNS) queue to which the event alert is delivered.

      • Function Compute: The Function Compute function to which the event alert is delivered.

      • URL Callback: The callback URL that can be accessed over the Internet. CloudMonitor sends a POST request to push an alert notification to the specified callback URL. You can enter only an HTTP URL. For more information about how to set callback URLs, see Configure callbacks for system event-triggered alerts.

      • Log Service: The Log Service Logstore to which the event alert is delivered.

  6. Click OK.

  7. Click OK.

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

    Note

    If you click Cancel, the alert template is created but not applied to application groups. For more information about how to apply an alert template to application groups, 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.

References