All Products
Search
Document Center

Add alert rules for slow query log

Last Updated: Jun 02, 2020

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.

Prerequisites

Procedure

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Alert Service > Alert Rules.

  3. In the upper-right corner of the Alert Rule page, click Add Rules.Create a rule

  4. 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.
  5. After the alert rule is created, choose Alert Service > Alert Templates in the left-side navigation pane.

  6. In the upper-right corner of the Alert Templates page, click Add Template.Create a Template

  7. 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.