You can configure alert rules for an AnalyticDB for MySQL cluster to monitor metrics such as CPU utilization, disk usage, IOPS utilization, query duration, and database connections. When a metric meets its alert condition, the system notifies all contacts in the specified alert contact group.
Background
AnalyticDB for MySQL supports monitoring and alerts through Alibaba Cloud CloudMonitor. With CloudMonitor, you can set alert rules for metrics. When a rule is triggered, CloudMonitor notifies all contacts in the specified alert contact group. You can also manage alert contact groups for your metrics to ensure that relevant personnel are notified.
Metrics include cluster CPU utilization, disk usage, IOPS utilization, query duration, and database connections. For more information, see AnalyticDB for MySQL (Data Warehouse Edition) 3.0. For example, you can configure an alert for disk usage. When disk usage is greater than or equal to 80%, the system sends an alert notification. If disk usage reaches 90% or more, the cluster is locked, an alert is sent, and write requests are rejected. This means that write operations fail with an error, but read operations are not affected. Immediate alerts for disk exceptions help you monitor and manage your disk space. However, each alert contact receives a maximum of four disk usage alerts per day. When you receive an alert, resolve the issue promptly to ensure your services run smoothly.
Procedure
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. Find the cluster that you want to manage and click the cluster ID.
In the left-side navigation pane, click Monitoring and Alerting.
Click the Alerts tab. On the Alerts page, click Create Alert Rule.
On the Create Alert Rule page, configure the parameters.
Parameter
Description
Resource Range
The scope of the alert rule. Valid values:
All Resources: This option applies the rule to all instances of a product under your account. For example, if you set an alert to be triggered when the disk usage of AnalyticDB for MySQL is greater than or equal to 80%, the rule applies to all AnalyticDB for MySQL instances. When the Resource Range is set to All Resources, alerts can be triggered for a maximum of 1,000 resources. If the number of resources exceeds 1,000, alerts may not be triggered even if the threshold is reached. We recommend that you use application groups to group resources by business before you configure alerts.
Application Group: The alert rule applies to all resources within a specified application group for the product.
Instance: The rule applies only to specific instances of the product. For example, if you set an instance-level alert for disk usage to be greater than or equal to 80%, a notification is sent when the disk usage of that specific instance meets or exceeds the threshold.
Rule Description
The conditions that trigger the alert. To configure the rule description:
Click Add Rule.
In the Add Rule Description panel, set parameters such as Rule Name, Metric Type, Monitoring Metric, Threshold and Alert Level, and Chart Preview.
Click OK.
Mute Period
The interval between repeated notifications for an unresolved alert. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours. When a metric reaches the alert threshold, an alert is sent. If the metric continues to exceed the threshold during the mute period, no repeated notifications are sent. If the condition is not resolved after the mute period ends, CloudMonitor sends another alert notification.
Effective Time
The period during which the alert rule is active.
ImportantFor disk usage alerts, each alert contact is notified a maximum of four times per day. Subsequent alerts are silenced.
Alert Contact Group
The contact group that receives alert notifications.
Notifications for application groups are sent to the contacts in this alert contact group. An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see Create an alert contact or an alert contact group.
Alert Callback
A publicly accessible URL. CloudMonitor pushes alert information to this URL through POST requests. Only the HTTP protocol is supported. For information about how to set up an alert callback, see Use threshold-based alert callbacks.
NoteClick Advanced Settings to configure this parameter.
Auto Scaling
If you enable Auto Scaling, the corresponding scaling rule is triggered when an alert occurs. You must specify the Region, ESS Group, and ESS Rule for Auto Scaling.
For information about how to create a scaling group, see Configure a scaling group.
For information about how to create a scaling rule, see Configure a scaling rule.
NoteClick Advanced Settings to configure this parameter.
Simple Log Service
If you enable Simple Log Service, alert information is written to Log Service when an alert occurs. You must specify the Region, Project, and Logstore for Log Service.
For information about how to create a Project and a Logstore, see Collect and analyze ECS text logs by using LoongCollector.
NoteClick Advanced Settings to configure this parameter.
Simple Message Queue (formerly MNS) - Topic
If you enable Simple Message Queue (formerly MNS) - Topic, alert information is sent to a specified topic in Message Service. You must specify the region and topic for Message Service.
For information about how to create a topic, see Create a topic.
Method for handling alerts when no monitoring data is available
The action to perform when monitoring data is unavailable for an alert rule. Valid values:
Do not do anything (default)
Send alert notifications
Consider as recovered
NoteClick Advanced Settings to configure this parameter.
Tag
Adds custom key-value pairs as tags to the alert content.
After you configure the parameters, click OK.