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 and handle them promptly.
Procedure
Log in 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 page, configure the following parameters.
Step
Description
Product
Keep the default value POLARDB MYSQL CLUSTER.
Resource Range
The scope of the alert rule. Valid values: All Resources, Application Groups, and Cluster.
NoteIf you set Resource Range to All Resources, an alert notification is sent when any cluster of the product meets the conditions described in the alert rule.
If you set Resource Range to Application Groups, you must also configure Application Group. An alert notification is sent only when a cluster in the specified application group of the product meets the conditions described in the alert rule.
If you set Resource Range to Cluster, an alert notification is sent only when the specified cluster meets the conditions described in the alert rule.
Description
The main part of the alert rule, which defines the conditions that trigger an alert when the monitoring data meets the specified conditions.
NoteFor more examples of alert rules, see Create a threshold-based alert rule.
Only most common scenarios are supported. For the actual supported Metric, refer to the CloudMonitor console. Some specific scenarios are not supported, such as alerting when SQL execution times out for 300 seconds.
Mute Period
The interval at which alert notifications are resent if the associated resource has not recovered after an alert is triggered. The minimum value is 1 minute and the maximum value is 24 hours.
Effective Date
The period during which the alert rule takes effect.
NoteAlert notifications are sent only within the effective time. Alerts generated outside the effective time are only recorded in the alert history.
Tag
The tags of the alert rule, including the tag key and tag value.
Alert Contact Group
The alert contact group to which alert notifications are sent.
NoteAlert notifications for an Application Groups are sent to the alert contacts in this alert contact group. An alert contact group is a group of alert contacts and can contain 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.
Advanced Settings
Alert Callback
A publicly accessible URL used to receive alert information pushed through POST requests. Only HTTP is supported. For information about how to configure an alert callback, see Use threshold alert callbacks.
To test the connectivity of the alert callback URL, perform the following operations:
Click Test next to the callback URL.
In the test panel, you can determine and troubleshoot the connectivity of the alert callback URL based on the status code returned by the webhook and the test result details.
NoteYou can also set the template type and language of the webhook, and then click Test again to obtain the corresponding test result details.
After the test is complete, click Close.
Push Channel
Auto Scaling
If you turn on the Auto Scaling switch, the corresponding scaling rule is triggered when an alert is triggered. You must configure the Region, ESS Group, and ESS Rule for auto scaling.
NoteClick Advanced Settings to configure this parameter.
For information about how to create an auto scaling group, see Create an ECS scaling group.
For information about how to create an auto scaling rule, see Configure scaling rules.
Simple Log Service
If you turn on the Simple Log Service switch, alert information is sent to a Logstore of Simple Log Service when an alert is triggered. You must configure the Region, ProjectName, and Logstore for Simple Log Service.
NoteClick Advanced Settings to configure this parameter.
For information about how to create a project and a Logstore, see Collect and analyze ECS text logs using LoongCollector.
Simple Message Queue (formerly MNS) - Topic
If you turn on the Simple Message Queue (formerly MNS) - Topic switch, alert information is sent to a topic of Message Service when an alert is triggered. You must configure the region and topic for Message Service.
NoteClick Advanced Settings to configure this parameter.
For information about how to create a topic, see Get started with topics.
Function Compute
If you turn on the Function Compute switch, alert notifications are sent to Function Compute for formatting when an alert is triggered. You must configure the region, service, and function for Function Compute.
NoteClick Advanced Settings to configure this parameter.
For information about how to create a service and a function, see Function creation.
Recovery Notification
Specifies whether to send a recovery notification when the monitoring metric recovers.
Method to handle alerts when no monitoring data is found
The method to handle alerts when no monitoring data is available. Valid values:
Do not do anything (default)
Send alert notifications
Treated as normal
Click Confirm.