All Products
Search
Document Center

AnalyticDB:Configure an alert rule

Last Updated:Dec 15, 2023

This topic describes how to configure alert rules for an AnalyticDB for MySQL cluster to monitor the cluster CPU utilization, disk usage, IOPS, query duration, and the 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.

Background information

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.

The metrics include CPU utilization, disk usage, IOPS, query duration, and the 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 for a cluster: When the disk usage is greater than or equal to 80%, the system sends an alert notification. When the disk usage is greater than or equal to 90%, the system sends an alert notification, locks the cluster, and denies data write requests. In this case, an error occurs if you write data. Data read requests are not affected. If the disk usage reaches the specified threshold, an alert notification is immediately sent to the specified contacts. This allows you to manage disk space when an issue occurs. Each contact can receive up to four alert notifications for disk usage every day. After you receive an alert notification, immediately resolve the issue to ensure that your business runs as expected.

Procedure

  1. Log on to the AnalyticDB for MySQL console.
  2. In the upper-left corner of the page, select a region.
  3. In the left-side navigation pane, click Clusters.
  4. On the Data Warehouse Edition (V3.0) tab, find the cluster and click the Cluster ID.

  5. In the left-side navigation pane, click Monitoring Information.

  6. On the Monitoring Information page, click Alert Rule Settings in the upper-right corner.

  7. On the Alert Rules page, click Create Alert Rule.

  8. In the Create Alert Rule panel, configure the parameters that are described in the following table.

    Parameter

    Description

    Product

    The name of the service for which you want to configure the alert rule. Select AnalyticDB for MySQL V3.0 - Data Warehouse Edition.

    Resource Range

    The resources to which you want to apply the alert rule. Valid values:

    • All Resources: The alert rule applies to all clusters of the specified service. For example, you set the Resource Range parameter to All Resources for a rule that triggers an alert if the disk usage of an AnalyticDB for MySQL cluster is greater than or equal to 80%. This alert rule applies to all AnalyticDB for MySQL clusters within your Alibaba Cloud 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 regardless of whether the rule conditions are met. Before you configure the alert rule, we recommend that you classify resources into different application groups by service based on your business requirements.

    • Application Groups: 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, you set the Resource Range parameter to Instances for a rule that triggers an alert if the disk usage of a cluster is greater than or equal to 80%. An alert is triggered only if the disk usage of the specified cluster is greater than or equal to 80%.

    Rule Description

    The content of the alert rule. This parameter specifies the conditions that trigger the alert. To specify the content of the alert rule, perform the following steps:

    1. Click Add Rule.

    2. In the Add Rule Description panel, configure the following parameters: Alert Rule, Metric Type, Metric, Threshold and Alert Level, and Chart Preview.

    3. Click OK.

    Mute For

    The interval at which CloudMonitor resends alert notifications before an alert is cleared. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours. If the conditions of an alert rule are met, an alert is triggered. If the alert is triggered within the mute period, CloudMonitor does not resend an alert notification. If the alert is not cleared after the mute period ends, CloudMonitor resends alert notifications.

    Effective Period

    The period during which the alert rule is effective. CloudMonitor monitors the specified resources based on the alert rule only within the specified period.

    Important

    Each contact can receive up to four alert notifications for disk usage every day.

    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 selected 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 specified. Only HTTP requests are supported. For information about how to configure an alert callback, see Use the alert callback feature to send notifications about threshold-triggered alerts.

    Note

    You can click Advanced Settings to configure this parameter.

    Auto Scaling

    If you turn on Auto Scaling and an alert is triggered, the specified scaling rule is enabled. In this case, configure the following parameters: Region, ESS Group, and ESS Rule.

    Note

    You can click Advanced Settings to configure this parameter.

    Log Service

    If you turn on Log Service and an alert is triggered, the alert information is written to Simple Log Service. In this case, configure the following parameters: 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 configure this parameter.

    Message Service - Topic

    If you turn on Message Service - topic and an alert is triggered, the alert information is written to the specified topic in Message Service (MNS). In this case, 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 if no monitoring data exists. Valid values:

    • Do not do anything (default)

    • Send alert notifications

    • Treated as normal

    Note

    You can click Advanced Settings to configure this parameter.

    Tag

    The tag that can be added to alert notifications. Each tag key is paired with a tag value. You can specify multiple pairs of tags.

  9. Click Confirm.