This topic describes how to manage the alert rules of an ApsaraDB RDS for PostgreSQL instance. You can turn on the Initiative Alert switch in the ApsaraDB RDS console to enable the default alert rules that are provided by the monitoring and alerting feature. You can also configure custom alert rules in the ApsaraDB RDS console. If the value of a metric meets the conditions that are specified in the alert rule for the metric, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group that is associated with the alert rule.

Background information

The monitoring and alerting feature of ApsaraDB RDS is implemented by using Cloud Monitor. Cloud Monitor allows you to configure metrics and alert rules. You can also associate alert groups with metrics. If a metric meets the conditions that are specified in an alert rule, alerts are sent as emails to all the contacts in the alert group that is associated with the metric.

Enable default alert rules

The default alert rules help you monitor crucial metrics and identify abnormal metrics at the earliest opportunity.

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Monitoring and Alerts.
  3. Click the Alerts tab.
  4. In the upper-right corner of the tab, turn on the Initiative Alert switch.
    Initiative Alert
    After you turn on the Initiative Alert switch, ApsaraDB RDS monitors the crucial metrics of the RDS instance based on the default alert rules. The following table describes the default alert rules.
    Alert rule Metric Statistics cycle Description
    SystemDefault_acs_rds_dashboard_PG_RO_ReadLag Read-only synchronization delay 60 seconds If the average value of the Read-only synchronization delay metric is greater than or equal to 7,200 seconds in five consecutive statistics cycles, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group.
    SystemDefault_acs_rds_dashboard_conn_usgae Connections Usage 60 seconds If the average value of the Connections Usage metric is greater than or equal to 90% in five consecutive statistics cycles, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group.
    SystemDefault_acs_rds_dashboard_local_fs_size_usage Disk Space Usage 60 seconds If the average value of the Disk Space Usage metric is greater than or equal to 90% in five consecutive statistics cycles, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group.
    SystemDefault_acs_rds_dashboard_cpu_usage CPU utilization 60 seconds If the average value of the CPU utilization metric is greater than or equal to 90% in five consecutive statistics cycles, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group.
    SystemDefault_acs_rds_dashboard_iops_usage IOPS Utilization 60 seconds If the average value of the IOPS Utilization metric is greater than or equal to 80% in five consecutive statistics cycles, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group.
    SystemDefault_acs_rds_dashboard_PG_MaxSlotWalDelay Maximum Replication Slot Latency 60 seconds If the average value of the Maximum Replication Slot Latency metric is greater than or equal to 1,024 MB in five consecutive statistics cycles, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group.
    SystemDefault_acs_rds_dashboard_PG_SwellTime Longest Transaction Duration 60 seconds If the average value of the Longest Transaction Duration metric is greater than or equal to 36,000 seconds in five consecutive statistics cycles, an alert is triggered. ApsaraDB RDS sends the alert to all contacts in the alert contact group.
  5. Optional. Specify an alert contact. If you do not specify an alert contact, ApsaraDB RDS specifies the owner of the Alibaba Cloud account as the alert contact. You can change the alert contact.
    1. Log on to the CloudMonitor console.
    2. In the left-side navigation pane, choose Alerts > Alert Contacts.
    3. On the Alert Contacts tab, click Create Alert Contact. For more information about how to create an alert contact, see Create an alert contact or alert contact group.
    4. In the search box on the Alert Contact Group tab, enter Default Contact Group to find the default contact group. Then, click the Edit icon icon in the Actions column for the default contact group.
    5. On the Create Alert Contact Group tab, change the alert contact.

Configure custom alert rules

ApsaraDB RDS allows you to configure custom alert rules for an RDS instance based on your business requirements. The following table describes the metrics that you can configure in custom alert rules.
PG_DBAge PG_InactiveSlots PG_MaxExecutingSQLTime
PG_MaxSlotWalDelay PG_RO_ReadLag PG_RO_StreamingStatus
PG_ReplayLatency PG_SwellTime PG_ActiveConnectionsPerCpu
PG_ConnectionsUtilization PG_CPUUtilization PG_IOPSUtilization
PG_INODEUtilization PG_DISKUtilization PG_MemoryUtilization
  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Monitoring and Alerts.
  3. Click the Alerts tab.
  4. Click Set Alert Rule to go to the CloudMonitor console.
    Alter Rule settings
  5. Create an alert contract group. For more information, see Create an alert contact or alert contact group.
  6. Create an alert rule. For more information, see Create a threshold-triggered alert rule.
    Note
    • When you create an alert rule, set the Product parameter to RDS-PostgreSQL.
    • You can also monitor resources based on tags. For more information, see Monitor resources based on tags.