You can create an alert rule in the PolarDB console to receive timely notifications about metric anomalies for your PolarDB cluster, PolarProxy, or compute nodes. This helps you quickly identify and address potential issues.
Procedure
-
Log on to the PolarDB console.
In the upper-left corner, select the region where the cluster is deployed.
Find the target cluster and click its ID.
-
In the left-side navigation pane, choose .
-
Click Add Alert Rule.
-
On the Create Alert Rule page, configure the following parameters.
Parameter
Description
Product
Keep the default value, PolarDB for MySQL.
Resource range
Specifies the scope of the alert rule. Valid values:
-
All Resources: An alert notification is sent when any cluster for the product meets the alert conditions.
-
Application Group: An alert notification is sent when a cluster in the specified application group meets the alert conditions.
-
Instance: An alert notification is sent only when the target cluster meets the alert conditions.
Description
Specifies the conditions that monitoring data must meet to trigger the alert. To set up the rule description:
-
Click Add Rule.
-
In the Add Rule Description panel, set the rule name, metric type, metric, threshold, and alert level.
-
Click OK.
NoteFor more examples of alert rules, see Create a threshold-based alert rule.
Mute period
The interval for resending notifications for a persistent alert. The mute period can be set from 5 minutes to 24 hours.
Effective Date
The period during which the alert rule is active.
NoteAlert notifications are sent only during the effective period. Alerts triggered outside this period are recorded in the alert history but do not trigger notifications.
Alert Contact Group
The contact group to which alert notifications are sent.
When an alert is triggered for an application group, notifications are sent to the contacts in the specified alert contact group. A group can include one or more alert contacts.
For information about how to create an alert contact and an alert contact group, see Create an alert contact or an Alert Contact Group.
Tag
The tag for the alert rule, which consists of a key and a value.
Advanced Settings
Alert callback
A publicly accessible URL that receives alert information through POST requests. Only HTTP is supported. For more information about how to configure an alert callback, see Use a threshold-based alert callback.
To test the connectivity of the alert callback URL, perform the following steps:
-
Click Test next to the callback URL.
In the Webhook test panel, you can check the status code returned by the webhook and the test result details to troubleshoot connectivity.
NoteYou can also configure the Callback Template Type and Language, and then click Test again to obtain the corresponding test result details.
-
Click Close.
Auto Scaling
If you enable Auto Scaling, the corresponding scaling rule is triggered when an alert occurs. You must specify the Region, Auto Scaling group, and scaling rule.
-
For information about how to create an Auto Scaling group, see Configure an Auto Scaling group.
-
For information about how to create a scaling rule, see Configure a scaling rule.
Simple Log Service
If you enable Simple Log Service, alerts are written to a Logstore in Simple Log Service when an alert occurs. You must specify the Region, ProjectName, and Logstore.
For information about how to create a project and a Logstore, see Use LoongCollector to collect and analyze ECS text logs.
Simple Message Queue
If you enable Simple Message Queue, alerts are written to the specified topic when an alert occurs. You must specify the region and topic.
For information about how to create a topic, see Create a topic.
Method for handling missing data
Specifies how to process alerts when monitoring data is missing. Valid values:
-
Take no action (Default)
-
Send notification for missing data
-
Treat as resolved
Step
Parameter
Description
Associated resources
Product
Keep the default value, PolarDB for PostgreSQL or PolarDB for Oracle.
Resource range
The scope of the alert rule. Valid values are All Resources and Cluster.
Note-
If you set Resource Range to All Resources, an alert notification is sent when any cluster for the product meets the alert conditions.
-
If you set Resource Range to Cluster, an alert notification is sent only when the target cluster meets the alert conditions.
Configure Alert Rule
Rule Name
Enter a name for the alert rule.
Description
Defines the conditions that monitoring data must meet to trigger an alert.
NoteFor more examples of alert rules, see Create a threshold-based alert rule.
Mute period
The interval for resending notifications for a persistent alert. The mute period can be set from 5 minutes to 24 hours.
Effective Date
The period during which the alert rule is active.
NoteAlert notifications are sent only during the effective period. Alerts triggered outside this period are recorded in the alert history but do not trigger notifications.
Notification method
For more information about the parameters in the Notification Method step, see Create a threshold-based alert rule.
-
-
Click Confirm.