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.
- A database instance that runs the MySQL or MongoDB database engine is created.
- The database instance is connected to DAS. For more information, see Access other self-managed database instances.
- The slow query log analysis feature is enabled for the database instance. For more information, see Slow query log analysis.
- Log on to the DAS console.
- In the left-side navigation pane, choose Alert Service > Alert Rules.
- On the Alert Rules page, click Add Rule in the upper-right corner.
- In the Add Rule dialog box, configure the parameters that are described in the following table and
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.
- In the left-side navigation pane, choose Alert Service > Alert Templates.
- On the Alert Templates page, click Create Template in the upper-right corner.
- In the Create Template dialog box, configure the parameters that are described in the following table and
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.