Create a custom monitoring product

更新时间:
复制 MD 格式

This topic describes how to create and configure a custom monitoring product.

Note

If you need to specify multiple Internet data centers (IDCs), logical data centers (LDCs), or single machines, separate the specified items with commas (,). Regular expressions are not supported.

Prerequisites

  • An application is published by using Cloud Application Fabric Engine (CAFE). You can view the application on the Application Monitoring page.

  • The business logs of an application to be created conform to the specified specifications, and log data is available.

  • You are familiar with the meaning of the column value fields in the business logs of an application to be created.

Procedure

  1. Log on to the Real-time Monitoring Service (RMS) console. In the left-side navigation pane, click Custom Monitoring.

  2. On the Custom Monitoring page, click Add.

  3. On the Frequently Used tab, click Minute-level Statistics/Keyless to go to the configuration page of the monitoring product.

  4. In the Basic Information section, set the Monitoring Configuration Name, Application, and Collect Log File parameters.

    If no log file is available in the Collect Log File drop-down list, click Scan to Select. In the Select Collection File dialog box, double-click the default path in the Specify Root Directory or Specify Server IP Address field and select log files.

    If you do not find the required log file by using the default path, set the Specify Root Directory or Specify Server IP Address parameter to find the required log file. Take note that you need only to set one of the Specify Root Directory and Specify Server IP Address parameters.

  5. In the Collection Filter section, you can customize collection filtering by selecting Online, Staging, or Staging Environment or by setting the LDC, IDC, or Standalone filter fields.

    Note

    If you need to specify multiple LDCs, IDCs, or single machines, separate the specified items with commas (,). Regular expressions are not supported.

  6. In the Log Filtering section, you can click Add Whitelist Filtering or Add Blacklist Filtering to specify keywords to filter logs. The whitelist is equivalent to the [Where Field =?] SQL clause. The blacklist is equivalent to the [Where Field < >?] SQL clause.

    • Whitelist-based filter column

      Click Add Whitelist Rule to add a whitelist-based filter column. In the Column Definition dialog box, set the parameters to configure the added column. Use the pointer to select a keyword in the Log Sample section. Then, RMS automatically generates a rule for selecting a column value based on the position of the keyword. At the same time, the sample column value that is generated based on the rule appears in the Column Value Sampling table. Enter the column name in the lower-right corner and click OK. A whitelist-based filter column is configured.

      The following examples describe the types of delimiters:

      • Printable characters, such as , . / { } +. We recommend that you use this type of delimiters.

      • Printable strings, such as "error".

      • Non-printable characters, such as spaces. We recommend that you not use this type of delimiters unless otherwise specified. If you use spaces as delimiters, we recommend that you enable the automatic space generation feature to separate multiple keywords. You can also use ASCII codes to separate non-printable characters. For example, enter char(1,2).

    • Whitelist column value

      You can specify one or more values for a column in the whitelist. Separate multiple values with commas (,). Example: aaaa,bbbb,cccc. Multiple filter columns in the whitelist take effect at the same time based on the AND logical operation. The logical relationship between the whitelist and blacklist is AND. The logical relationship among multiple blacklist-based filter columns is OR.

  7. In the Statistical Method section, select the calculation methods of the logs from the Value Calculation Method drop-down list. Minute-level Statistics/Keyless monitoring products support the following seven calculation methods:

    • Calculate Rows: the number of log entries generated in unit time.

    • Calculate Average of Column Values: You must select column values in the Average Value Column section beforehand.

    • Calculate Sum of Column Values: You must select column values in the Sum Column section beforehand.

    • Calculate Minimum Column Value: You must select column values in the Min. Value section beforehand.

    • Calculate Maximum Column Value: You must select column values in the Max. Value section beforehand.

    • Count Occurrences of Specified Content: the number of times that a specific text occurs in a row. You must specify the text in the Valid Column Values section.

    • Divide Values of Two Columns to Calculate the Quotient: the quotient of the total value of a column generated in 1 minute divided by the total value of another column in the same period. You must select column values in the This number (dividend) and Divide by (divisor) sections. This calculation method is frequently used in log statistics, such as dividing the total time consumed by the total number of requests.

      In this example, the Calculate Rows calculation method is used.

  8. Click New Alert Package, Add Alert Rule, and then Add Trigger Condition. In the Alert Trigger Condition dialog box, set the Value Setting Method, Threshold Comparison Method, and SMS Threshold parameters, and click OK.

    Note

    In this step, you can configure an alert rule to send alert notifications by using text messages. RMS allows you to configure alert rules in a visualized manner. You can configure various alert rules, specify trigger conditions, and specify alert rules for different periods of time.

    • Alert level

      You can set the Alert Level parameter to better manage alerts. This parameter indicates the severity level of an alert. The alerts are categorized in the Alert Information section of the Overview page by alert level. Information about alert levels is also provided in alert notifications. RMS provides five alert levels: Red Alert (P0), Orange Alert (P1), Common Alert (P2), Common Alert (P3), and Common Alert (P4). In this example, the alert level is set to Common Alert (P2).

    • In this step, you can also set the Detection Frequency (Interval in Minute) parameter to specify the interval at which the alert rule is triggered for monitoring. For example, if you set this parameter to 5, the alert rule is triggered every 5 minutes. If you set this parameter to 60, the alert rule is triggered every hour on the hour. By default, this parameter is set to 1. In this example, the alert rule is triggered at the default interval.

  9. To test the proceeding configurations, click Debug Configuration and Debug Alerts in the lower part of the page.

    • On the Debug Configuration page, click Debug.

    • On the Debug Alerts page, click Debug.

      After the debugging is complete, return to the configuration page and click Submit in the lower part of the page. This way, a custom monitoring product is configured, and a corresponding data source is created.