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.
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.
|Instance resource type||Threshold-triggered alert||Event-triggered alert|
|Flexible storage mode||Supported||Unsupported|
|Reserved storage mode||Supported||Supported|
View monitoring data
- Log on to the AnalyticDB for PostgreSQL console.
- Select a region in which the instance is deployed.
- Find the instance and click its ID to go to the Basic Information page.
- In the upper-right corner of the page, click CloudMonitor to go to the CloudMonitor console.
CloudMonitor provides different metrics for instances in flexible storage mode and instances in reserved storage mode. However, metrics cannot be filtered by resource type. All metrics are displayed on the same page.
- Move the pointer over a chart and click the enlarge icon to zoom in the chart. Note Metric names of compute nodes are displayed in different ways 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
- 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.
- On the page that appears, configure an alert rule. To configure multiple alert rules,
click Add Alert Rule. 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: You can select metrics whose names start with flexible for instances in flexible storage mode, and select metrics whose names start with reserved for instances in reserved storage mode.
- 1 Minute 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 within 1 minute. If you select 1 Minute cycle, one data point is generated and no aggregation is required. If you select 5 Minute cycle, five data points are generated and the system aggregates the five data points into one data point.
- Duration: If you select Continue for 3 periods for 1 Minute cycle, the alert is triggered after the metric value exceeds the threshold for 3 minutes.
- Average value, maximum value, and minimum value: If you select 5 Minute cycle, five data points need to be aggregated. Suppose 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. 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.
- Select an existing contact group or create a contact group.
- (Optional) Enter the email content.
- Click Confirm to go to the Alert Rules page. The created threshold-triggered alert is displayed.
On the Threshold Value Alert tab, you can view the alert status or alert logs. You can also disable the alert.
Configure an event-triggered alert
- In the CloudMonitor console, choose .
- 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.
Event name Description The instance is unavailable. The instance cannot be connected or cannot process requests. No alerts are triggered when the instance is restarted, created, upgraded, deleted, or locked. The number of long-running transactions is greater than or equal to 5. If a transaction is active for more than 2 hours but is not in the idle state and holds a lock, it is defined as a long-running transaction.
- Set Contact Group and Notification Method, and then click OK.
On the Event Alert tab, you can view the alert status or alert logs. You can also disable the alert.