This topic describes how to configure an alert rule for an AnalyticDB for PostgreSQL instance to monitor resource usage. If the conditions specified in an alert rule are met, the system notifies all contacts in the specified contact groups.

Background information

The monitoring and alerting feature of AnalyticDB for PostgreSQL is implemented by using CloudMonitor. CloudMonitor allows you to set metrics and specify contact groups. If an alert is triggered, CloudMonitor notifies all contacts in the specified contact groups. You can maintain contact groups for metrics to ensure that the contacts receive alerts at the earliest opportunity.

CloudMonitor supports threshold-triggered and event-triggered alert rules. The following table describes the supported alert rule types for different instance resource types.
Instance resource type Threshold-triggered alert Event-triggered alert
Elastic storage mode Supported Not supported
Reserved storage mode Supported Supported
Note To enable the monitoring and alerting feature, you must configure alert rules.

View monitoring data

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, click Cloud products.
  3. On the Cloud products page, choose Database > AnalyticDB for PostgreSQL.
  4. Click the ID of the AnalyticDB for PostgreSQL instance to go to the Cloud product charts - AnalyticDB for PostgreSQL page.
  5. Move the pointer over a chart and click the enlarge icon to view the chart in full screen.
    2021040608
    Note The metric names of compute nodes are displayed in different manners in the CloudMonitor and AnalyticDB for PostgreSQL consoles. In the AnalyticDB for PostgreSQL console, the names of compute nodes are displayed. In the CloudMonitor console, the names of the hosts for compute nodes are displayed.

Configure a threshold-triggered alert

  1. In the CloudMonitor console, move the pointer over a chart and click the alert icon to configure a threshold-triggered alert for the corresponding metric. 2021040609
  2. On the Create Alert Rule page, configure an alert rule. To configure multiple alert rules, click Add Alert Rule in the Set Alert Rules section. You can create an individual alert rule for each metric. If the value of a metric exceeds the related threshold, the system sends you an alert notification.
    • Metric: For information about the metrics and recommended settings, see Metrics and system events.
    • 1Minute cycle: The monitoring data within 1 minute is aggregated into one monitoring data point for comparison with the specified threshold. CloudMonitor provides one data point per minute. If you select 1Minute cycle, one data point is generated and no aggregation is required. If you select 5Minute cycle, five data points are generated and the system aggregates the five data points into a single data point.
    • Repeat: If you select Continue for 3 periods for 1Minute cycle, the alert is triggered after the aggregated metric value exceeds the threshold for 3 consecutive minutes (for 3 repeats).
    • Average, Max. Value, and Min. Value: If you select 5Minute cycle, five data points must be aggregated. Assume that the five data points are 10, 20, 30, 40, and 50. The average value is 30, the maximum value is 50, and the minimum value is 10. You can specify a threshold for the average value, the maximum value, or the minimum value.
    • instance_component: You can select a specific server or component for which you want to create the alert rule. You can also select All.
    • Mute for: This parameter specifies the interval at which an alert notification is sent if the issue is not rectified after the first notification.
  3. Select an existing contact group or create a contact group.
  4. (Optional) Enter the email content.
  5. Click Confirm to go to the Alert Rules page. The created threshold-triggered alert rule is displayed.

    On the Threshold Value Alert tab, you can view the alert state or alert logs. You can also disable the alert.

Configure an event-triggered alert

  1. In the CloudMonitor console, choose Alerts > Alert Rules.
  2. On the Event Alert tab, click Create Event Alert.
    • Product Type: Select AnalyticDB for PostgreSQL.
    • Event Type: Select All types or a specific type.
    • Event Level: Select All Levels or a specific level.
    • Event Name: Select All Events or a specific event.

      For more information about system events, see Metrics and system events.

  3. Set Contact Group and Notification Method, and then click OK.

    On the Event Alert tab, you can view the alert state or alert logs. You can also disable the alert.