DAS provides the slow SQL query alerting feature. When the threshold of slow SQL query logs is reached, alert messages are sent to you by SMS, email, or DingTalk.
The slow SQL alerting feature is only available to MySQL and MongoDB databases.
DAS has accessed the database instance. For more information, see Access other user-created database instances.
The slow-query log analysis feature is enabled for the database instance. For more information, see Analyze slow query logs.
Log on to the DAS console.
In the left-side navigation pane, choose Alert Service > Alert Rules.
In the upper-right corner of the Alert Rule page, click Add Rules.
In the Alert Rule dialog box, configure the parameters and then click OK.
Parameter Description Rule Name The name of the alert rule. For this example, it is Slow SQL alert. Type Select Threshold Alert. Description Select Slow SQL Statements of MySQL Instance per Hour or Slow SQL Statements of MongoDB Instance per Hour and set the threshold value as needed. Alert Interval The interval to send an alert message when the alert rule is triggered. Effective Time The time range when the alert rule takes effect. Notification Method The method used to send alert messages. It can be SMS, email, DingTalk, or a combination.
After the alert rule is created, choose Alert Service > Alert Templates in the left-side navigation pane.
In the upper-right corner of the Alert Templates page, click Add Template.
In the Add Template dialog box, configure the parameters and then click OK.
Parameter Description Template Name The name of the template. Template Type Is fixed to Database Resource Template. Select Rule Select existing alert rules. For this example, it is Slow SQL alert.