You can save the alert rules configured for an AnalyticDB for PostgreSQL instance into an alert template. Then, you can create or modify an alert rule directly by using the alert template instead of repeatedly configuring the alert rule.
- Alert templates must be used together with application groups. You can create an application group first. Then, you can create an alert template and apply the alert template to the application group to create alert rules for the application group. This simplifies the creation and maintenance of alert rules. For information about how to create an application group, see Create an application group.
- When you create an alert template, take note of the following limits:
- Up to 100 alert templates can be created for each Alibaba Cloud account.
- Up to 30 metrics can be specified in each alert template.
Create an alert template
- Go to the Alert Templates page. Perform the following steps:
- Log on to the CloudMonitor console.
- In the left-side navigation pane, choose .
- Create an alert template. Perform the following steps:
- In the upper-right corner of the Alert Templates page, click Create Alert Template.
- In the Create/modify alert templates panel, enter a template name in the Template Name field, click Products, and then select AnalyticDB for PostgreSQL from the drop-down list.
- Click Add Rules in the AnalyticDB for PostgreSQL section to configure alert rules for the alert template. The following types of alert templates are supported in CloudMonitor:
- Metric Template
The following table describes the parameters that you can configure for the rules in a metric template.
Parameter Description Rule Name The name of the threshold-triggered alert rule. Metric Name The name of the metric. For more information about the metrics in AnalyticDB for PostgreSQL, see Metrics and system events. role
The compute node or compute group to monitor.
You can select All to monitor all instances or select a specific compute node or compute group to monitor within an instance.
Threshold and Notification Methods The alert condition, alert threshold, and alert level of the rule.
You can configure multiple alert levels. When the alert threshold falls within different ranges, the rule triggers alerts at different alert levels. CloudMonitor sends alert notifications by using different methods.
- Event Template
Event-triggered alert rules can be configured only for system events. The following table describes the parameters that you can configure for the rules in an event template.
Parameter Description Rule Name The name of the event-triggered alert rule. Event Type The type of the event that triggers alerts. For more information, see Metrics and system events. Event Level The level of the event that triggers alerts. For more information, see Metrics and system events. Event Name The name of the event that triggers alerts. For more information, see Metrics and system events. MNS queue The specified queue in Message Service (MNS) to which the event alert is delivered. Function service The specified function of Function Compute to which the event alert is delivered. URL callback The callback URL and request method. Enter a callback URL that can be accessed over the Internet. CloudMonitor sends a POST or GET request to push an alert to the specified callback URL. Only HTTP requests are supported. For more information about how to configure callbacks, see Configure callbacks for system event-triggered alerts. Log Service The specified Logstore in Log Service to which the event alert is delivered.
- Metric Template
- Click OK to save the alert rule.
- Click OK to save the alert template.
- In the Create/modify alert template complete message, click OK. Note If you click Cancel, the alert template is created but not applied to application groups. For more information about how to apply an alert template to an application group, see Apply an alert template to an application group.
- In the Apply Template to Group dialog box, select an application group and set the Muted, Effective Period, HTTP WebHook, and Option parameters.
- Click OK.
- In the Apply Template to Group message, click OK.