Database Autonomy Service (DAS) provides the alert feature. When the number of slow SQL queries exceeds a specific threshold value, DAS can send alerts to you by SMS, email, or DingTalk.

Prerequisites

Procedure

  1. Log on to the DAS console.
  2. In the left-side navigation pane, choose Alert Service > Alert Rules.
  3. On the Alert Rules page, click Add Rule in the upper-right corner.
  4. In the Add Rule dialog box, configure the parameters that are described in the following table and click OK.
    Parameter Description
    Rule Name The name of the alert rule. For example, you can set the name to Alert rule for slow SQL queries.
    Type The type of the alert rule. Set this parameter to Threshold Alert.
    Description The description of the alert rule. In this example, select Slow SQL Statements of MySQL Instance per Hour or Slow SQL Statements of MongoDB Instance per Hour and set the threshold value.
    Alert Interval The interval at which the system sends alerts to you when the alert rule is triggered.
    Effective Time The period of time within which the alert rule takes effect.
    Notification Method The method that is used to send alerts. DAS can send alerts by SMS, DingTalk chatbot, and email.
  5. In the left-side navigation pane, choose Alert Service > Alert Templates.
  6. On the Alert Templates page, click Create Template in the upper-right corner.
  7. In the Create Template dialog box, configure the parameters that are described in the following table and click OK.
    Parameter Description
    Template Name The name of the alert template.
    Template Type The type of the alert template. Set the template type to Database Resource Template.
    Select Rule The alert rule. In the left-side section, select the Alert rule for slow SQL queries alert rule and click the right arrow to add the rule.
    Alert Contact The contacts to which alerts are sent. You can select contacts from the Existing Contact Group list or create a contact group. For more information, see Manage alert contacts.