This topic describes how to set alert rules for an AnalyticDB for MySQL cluster to monitor the cluster CPU utilization, disk usage, IOPS, 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 clusters and generates alerts by using CloudMonitor. For more information, see What is CloudMonitor? CloudMonitor allows you to set metrics to be monitored. If an alert is triggered, CloudMonitor notifies all contacts in the specified alert contact groups. You can maintain contact groups for alert metrics to ensure that the contacts are notified as soon as they are triggered.

These metrics include the cluster CPU utilization, disk usage, IOPS, and number of database connections. You can configure alert rules based on the metrics. For example, you can configure the following alert rule: If the disk usage is equal to or greater than 90%, the system blocks data write requests. If you write data in this case, an error occurs. 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 by your Alibaba Cloud account.
  2. In the upper-left corner of the page, select the region where clusters reside.
  3. In the left-side navigation pane, click Clusters.
  4. On the V3.0 Clusters tab, click the target 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.
    Note For information about each metric on the Monitoring Information page, see View monitoring information.
  7. On the Threshold Value Alert tab of the Alert Rules page, click Create Alert Rule.
  8. On the Create Alert Rule page, specify the following parameters.
    Parameter Description
    Product The name of the service for which you want to set the alert rule. Select AnalyticDB for MySQL V3.0.
    Resource Range The resources to which the alert rule applies. Valid values: Cluster and All Resources.
    • All Resources: The alert rule applies to all your instances of the specified service. For example, 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 equal to or greater than 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 more than 1,000 resources of the specified service are created within your account, the system may not generate an alert even if the rule conditions are met. We recommend that you classify resources of the same service into different application groups based on your business requirements before you set the alert rule.
    • Cluster: The alert rule applies only to the specified cluster. For example, you set Resource Range to Cluster for a rule that triggers an alert if the disk usage of a cluster is equal to or greater than 90%. An alert is triggered only if the disk usage of the specified cluster is greater than or equal to 90%.
    Alert Rule The name of the alert rule.
    Rule Description The content of the alert rule. This parameter defines the alert trigger conditions. For example, you define a rule that triggers alerts if the average disk usage in the last 5 minutes is greater than or equal to 90%. The system checks whether the trigger condition is met once every 5 minutes.
    Mute for The interval of re-sending the notification for an alert before the alert is cleared.
    Effective Period Set the period during which the alert rule takes effect. The system monitors the metrics and generates alerts only if the alert rule takes effect.
    Notification Contact The contact groups to which alert notifications are sent.
    Notification Methods

    The method used to send notifications. Default value: Email + DingTalk (Info).

    Auto Scaling If you select Auto Scaling, a specific scaling rule is triggered when an alert is generated. You must set the Region, ESS Group, and ESS Rule parameters.
    Log Service If you select Log Service, the alert information is written to Log Service when an alert is generated. You must set the Region, Project, and Logstore parameters.

    For more information about how to create a project and a Logstore, see Quick Start.

    Email Remark Enter the additional information that you want to include in the alert notification email.
    HTTP CallBack The URL that can be accessed from the Internet. CloudMonitor uses a POST request to send an alert notification to this URL. Only HTTP requests are supported. For more information, see Use the alert callback feature to report threshold-triggered alerts.
  9. After you specify the preceding parameters, click Confirm.