ApsaraDB RDS integrates with CloudMonitor to monitor your PostgreSQL instance and send email notifications to your alert contact group when a metric crosses a threshold. Two approaches are available: enable Initiative Alert for instant coverage with seven preset rules, or create custom alert rules for metrics and thresholds tailored to your workload.
How alert rules work
Alert rules sample a metric at a fixed statistical period (for example, every 60 seconds) and trigger an alert when the sampled value exceeds a threshold for a specified number of consecutive periods. For example, if the CPU Utilization threshold is 90% with a statistical period of 60 seconds and a duration of 5 consecutive periods, an alert fires only after CPU stays above 90% for 5 minutes straight — not on a single spike. CloudMonitor then emails all contacts in the configured alert contact group.
Enable Initiative Alert
Initiative Alert applies seven preset rules to your instance instantly, covering the most critical PostgreSQL-specific metrics. No manual threshold configuration is required.
Prerequisites
Before you begin, ensure that you have:
An ApsaraDB RDS for PostgreSQL instance
An Alibaba Cloud account (the account owner is set as the default alert contact)
Turn on Initiative Alert
Go to the Instances page. In the top navigation bar, select the region where the instance resides, then click the instance ID.
In the left-side navigation pane, click Monitoring and Alerts.
Click the Alerts tab.
In the right-side section of the page, turn on the Initiative Alert switch.
The system immediately begins monitoring the following metrics:
| Rule name | Metric | Statistical period | Alert threshold |
|---|---|---|---|
| SystemDefault_acs_rds_dashboard_PG_RO_ReadLag | Synchronization Latency of Read-only Instances | 60 seconds | Average ≥ 7,200 seconds for 5 consecutive periods |
| SystemDefault_acs_rds_dashboard_conn_usage | Connections Usage | 60 seconds | Average ≥ 90% for 5 consecutive periods |
| SystemDefault_acs_rds_dashboard_local_fs_size_usage | Disk Usage | 60 seconds | Average ≥ 90% for 5 consecutive periods |
| SystemDefault_acs_rds_dashboard_cpu_usage | CPU Utilization | 60 seconds | Average ≥ 90% for 5 consecutive periods |
| SystemDefault_acs_rds_dashboard_iops_usage | IOPS Utilization | 60 seconds | Average ≥ 80% for 5 consecutive periods |
| SystemDefault_acs_rds_dashboard_PG_MaxSlotWalDelay | Maximum Replication Slot Latency | 60 seconds | Average ≥ 1,024 MB for 5 consecutive periods |
| SystemDefault_acs_rds_dashboard_PG_SwellTime | Longest Transaction Duration | 60 seconds | Average ≥ 36,000 seconds for 5 consecutive periods |
(Optional) Update the alert contact
By default, alert notifications are sent to the Alibaba Cloud account owner. To add or change contacts:
Log on to the Cloud Monitor console.
In the left-side navigation pane, click Alert ContactsDefault Contact Group.
On the Alert Contacts tab, click Create Alert Contact. For details, see Create an alert contact or alert contact group.
On the Alert Contact Group tab, search for Default Contact Group, then click the
icon.On the Modify Contact Group panel, update the contacts.
Configure custom alert rules
For metrics not covered by Initiative Alert, or to apply different thresholds, create custom alert rules in CloudMonitor. Alerts are sent by email to all contacts in the alert contact group you specify.
The following metrics are available for custom rules:
| Metric |
|---|
| 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 |
Create a custom alert rule
Go to the Instances page. In the top navigation bar, select the region where the instance resides, then click the instance ID.
In the left-side navigation pane, click Monitoring and Alerts.
Click the Alerts tab.
In the right-side section of the page, click Set Alert Rule to open the CloudMonitor console.
Create an alert contact group. For details, see Create an alert contact or alert contact group.
Create an alert rule. For details, see Create an alert rule.
When creating the alert rule, set the Product parameter to ApsaraDB RDS for PostgreSQL.
You can also monitor resources based on tags. For details, see Monitor resources based on tags.