All Products
Search
Document Center

ApsaraDB RDS:Manage alert rules for PostgreSQL

Last Updated:Aug 07, 2026

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

  1. Go to the Instances page. In the top navigation bar, select the region where the instance resides, then click the instance ID.

  2. In the left-side navigation pane, click Monitoring and Alerts.

  3. Click the Alerts tab.

  4. 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:

  1. Log on to the Cloud Monitor console.

  2. In the left-side navigation pane, click Alert ContactsDefault Contact Group.

  3. On the Alert Contacts tab, click Create Alert Contact. For details, see Create an alert contact or alert contact group.

  4. On the Alert Contact Group tab, search for Default Contact Group, then click the Edit icon icon.

  5. 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

All custom alert metrics for PostgreSQL instances are instance-level and are dimensioned by userId and instanceId. Session-level metrics, such as execution duration and transaction duration, are not available as alert metrics, so you cannot create alert rules for them.

To monitor long-running transactions, create a custom alert rule based on one of the following instance-level metrics:

  • PG_SwellTime: the duration of the longest running transaction, in seconds. The alert fires when this duration exceeds your threshold.

  • PG_one_minute_transactions: the number of transactions that have run for more than 1 minute. The alert fires when this count exceeds your threshold.

Create a custom alert rule

  1. Go to the Instances page. In the top navigation bar, select the region where the instance resides, then click the instance ID.

  2. In the left-side navigation pane, click Monitoring and Alerts.

  3. Click the Alerts tab.

  4. In the right-side section of the page, click Set Alert Rule to open the CloudMonitor console.

  5. Create an alert contact group. For details, see Create an alert contact or alert contact group.

  6. Create an alert rule. For details, see Create an alert rule.

Note

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.