This topic describes how to set alert rules for an AnalyticDB for MySQL cluster to monitor the cluster CPU utilization, disk usage, IOPS, query duration, and number of database connections in real time. If the conditions specified in an alert rule are met, the system notifies all contacts in the specified contact groups.
AnalyticDB for MySQL monitors cluster information and generates alerts by using CloudMonitor. For more information, see What is 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.
These metrics include the cluster CPU utilization, disk usage, IOPS, query duration, and number of database connections. For more information, see AnalyticDB for MySQL V3.0. You can configure alert rules based on the metrics. For example, you can configure the following alert rule: If the disk usage is greater than or equal to 90%, the system blocks data write requests. In this case, an error occurs if you write data. Data read requests are not affected. When the disk usage reaches the specified threshold, an alert is immediately sent to the specified contacts. This allows you to manage disk space as soon as issues arise and ensures the normal operation of your business.
- Log on to the AnalyticDB for MySQL console.
- In the upper-left corner of the page, select the region where the cluster resides.
- In the left-side navigation pane, click Clusters.
- On the Data Warehouse Edition (V3.0) tab, find the cluster and click its Cluster ID.
- In the left-side navigation pane, click Monitoring Information.
- On the Monitoring Information page, click Alert Rule Settings in the upper-right corner.
- On the Alert Rules page, click Create Alert Rule.
- In the Create Alert Rule panel, configure the parameters described in the following table.
Parameter Description Product The name of the service for which you want to set the alert rule. Select AnalyticDB for MySQL V3.0 - Data Warehouse Edition. Resource Range The resources to which the alert rule applies. Valid values:
- All Resources: The alert rule applies to all clusters of the specified service. For example, assume that you set Resource Range to All Resources for a rule that triggers an alert if the disk usage of an AnalyticDB for MySQL V3.0 cluster is greater than or equal to 90%. This alert rule applies to all AnalyticDB for MySQL V3.0 clusters within your account. Each alert rule can be applied to up to 1,000 resources for a specified service. If your account contains more than 1,000 resources of the specified service, the system may not generate an alert even if the rule conditions are met. We recommend that you sort resources into different application groups by service based on your business requirements before you set the alert rule.
- Application Group: The alert rule applies to all resources in the specified application group of the specified service.
- Instances: The alert rule applies to the specified instances of the specified service. For example, assume that you set Resource Range to Instances for a rule that triggers an alert if the disk usage of a cluster is greater than or equal to 90%. An alert is triggered only if the disk usage of the specified cluster is greater than or equal to 90%.
Rule Description The content of the alert rule. This parameter defines the alert trigger conditions. To configure the content of the alert rule, perform the following steps:
- Click Add Rules.
- In the Add Rule Description panel, specify Alert Rule, Metric Type, Metric, Threshold and Alert Level, and Chart Preview.
- Click OK.
Mute For The interval at which CloudMonitor sends alert notifications. If the first alert notification is sent and the specified threshold is still reached, another alert notification is sent. Valid values: 5 min, 15 min, 30 min, 60 min, 3 h, 6 h, 12 h, and 24 h. An alert is triggered when the conditions of an alert rule are met. CloudMonitor does not resend an alert notification if the alert is triggered within the mute period. If the alert is not cleared after the mute period ends, CloudMonitor resends alert notifications. Effective Time The period of time during which the alert rule is effective. The system monitors the metrics and generates alerts only during this period. Alert Contact Group The alert contact group to which alert notifications are sent.
The alert notifications of the application group are sent to the alert contacts that belong to the alert contact group. An alert contact group 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 alert contact group.
Alert Callback The callback URL that can be accessed over the Internet. CloudMonitor sends a POST request to push an alert to the callback URL that you specify. Only HTTP requests are supported. For information about how to configure alert callbacks, see Use the alert callback feature to send notifications about threshold-triggered alerts.Note You can click Advanced Settings to set this parameter. Auto Scaling If you turn on Auto Scaling, the specified scaling rule is enabled when an alert is triggered. In this case, you must specify Region, ESS Group, and ESS Rule.
Note You can click Advanced settings to set this parameter.
- For information about how to create a scaling group, see Create a scaling group.
- For information about how to create a scaling rule, see Create a scaling rule.
Log Service If you turn on Log Service, the alert information is written to Log Service when an alert is triggered. In this case, you must specify Region, Project Name, and Logstore.
For information about how to create a project and a Logstore, see Getting Started.Note You can click Advanced Settings to set this parameter.
Message Service - topic If you turn on Message Service - topic, the alert information is written to the specified topic in Message Service (MNS) when an alert is triggered. In this case, you must select a region and a topic. For information about how to create a topic, see Create a topic. Method to handle alerts when no monitoring data is found The method that is used to handle alerts when no monitoring data is found. Default value: Do not do anything. Valid values:
Note You can click Advanced Settings to set this parameter.
- Do not do anything
- Send alert notifications
- Treated as normal
Tag The tag that can be added to alert notifications. Each tag key is paired with a tag value. You can set multiple pairs of tags.
- After you configure the parameters, click OK.