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.

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.

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.

Procedure

  1. Log on to the AnalyticDB for MySQL console.
  2. In the upper-left corner of the page, select the region where the cluster resides.
  3. In the left-side navigation pane, click Clusters.
  4. On the Data Warehouse Edition (V3.0) tab, find the cluster and click its 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 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:
    1. Click Add Rules.
    2. In the Add Rule Description panel, specify Alert Rule, Metric Type, Metric, Threshold and Alert Level, and Chart Preview.
    3. 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.
    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:
    • Do not do anything
    • Send alert notifications
    • Treated as normal
    Note You can click Advanced Settings to set this parameter.
    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.
  9. After you configure the parameters, click OK.