Configure custom business monitoring
This guide shows you how to quickly configure custom monitoring. It uses the Minute Statistics/Keyless monitoring product as an example.
About this task
The Minute Statistics/Keyless monitoring product filters keywords at fixed positions in logs to collect statistics on a single metric. For example, it can count the total number of times an interface is called.
For more information about the application scenarios and details of this product, see Minute Statistics/Keyless.
Configuring custom monitoring involves the following steps:
Log filtering provides two methods for filtering log keywords: Add Whitelist Filter and Add Blacklist Filter.
A whitelist is equivalent to the
[Where Field =?]clause in an SQL statement.A blacklist is equivalent to the
[Where Field <>?]clause in an SQL statement.
The Minute Statistics/Keyless product provides the following methods for calculating statistics from logs:
Count rows: The number of log rows within a unit of time.
Average of column values: Select a numeric dimension for calculation, such as time consumed or amount.
Sum of column values: Select a numeric dimension for calculation, such as time consumed or amount.
Maximum of column values: Select a numeric dimension for calculation, such as time consumed or amount.
Minimum of column values: Select a numeric dimension for calculation, such as time consumed or amount.
You can configure alerts to receive fault notifications by text message. The visual interface for real-time monitoring lets you configure multiple alert rules, multiple conditions for each rule, and different alert settings for different time periods.
Procedure
Step 1: Select a monitoring product
Log on to the console. In the navigation pane on the left, click Custom Monitoring.
On the Custom Monitoring page, click New > New Monitoring Product to add a monitoring product.
On the Common tab, click Minute Statistics/Keyless to open the configuration page for the Minute Statistics/Keyless monitoring product.
Step 2: Enter basic information
In the Basic Information section, configure the following parameters:
Monitoring Configuration Name: Enter a custom name for the monitoring configuration.
Application: Select the application to which this monitoring product belongs.
Log File to Collect: Select a log file. You can use the following methods to collect logs:
Scan Path: If the log file you need is not in the list, complete the following steps. The Scan Path method is used by default:
Click Scan Path to open the Select Collection File page. This page displays two default system file paths.
Double-click a path name to select a log file. If you cannot find the required path in the default file paths, you can enter a Specified Root Directory or Specified Server IP to find the log file.
Select the required log file name, and then click Confirm.
Manually Enter Log Path: Enter the log path manually. Note the rules for the path format.
Select whether to enable the Effective Switch. This feature is enabled by default.
(Optional) Click Advanced Options and configure the following information:
Log encoding method.
Cluster log traffic limit in KB/min.
Maximum Storage Capacity: Select the upper limit.
Step 3: Configure log filtering
Enable the log filtering switch. The following steps use adding a whitelist filter rule as an example:
Click Add Whitelist Filter to add a new whitelist filter column.
In the Whitelist Filter Column, click Select.
In the Log Filtering dialog box, configure the position of the whitelist filter column.
In the log sample, select a target keyword. The system automatically generates a Column Value Selection Rule based on the position of the keyword and displays the sampled column values in the table below.
At the bottom of the page, enter a column name and click Submit.
For more information about how to use the Use Column Value Translation feature in the Log Filtering dialog box, see Column Value Translation.
Enter the Whitelist Value.
Note: For the same column, you can specify multiple whitelist values. Separate the values with commas (,), such as
aaaa,bbbb,cccc. The relationship between multiple Whitelist Filter Columns is AND.
Step 4: Set column value grouping
Column value grouping is equivalent to the GROUP BY clause in SQL and specifies how the final data is grouped. Real-time Monitoring Service (RMS) supports grouping by label, which is also known as grouping by O&M dimension. For example, you can group by data center (IDC).
You must configure at least one dimension for column value grouping. You can configure multiple grouping columns.
You can select an O&M dimension column to use as a grouping column. To customize a grouping column, click Add Grouping Column > Select and define the column value selection rule in the Log Filtering dialog box.
In the log sample, select a target keyword. The system automatically generates a column value selection rule based on the position of the keyword and displays the sampled column values in the table below.
Step 5: Select a statistics collection method
In this step, select Count Rows as the calculation method.
Step 6: Configure alerts
Enable the alert configuration switch, and then click the Add Alert Rule button.
In the input box under the Alert Rule column, enter a rule name, select a time range, and then set the trigger conditions. Trigger conditions include the value retrieval method (the rule's calculation method), comparison method, and threshold.
If you need multiple trigger conditions, click Add Trigger Condition to configure them. If you have multiple trigger conditions, select whether the alert is triggered when All conditions are met or Any condition is met.
Set the Alert Level and Detection Frequency. If required, select Customize Alert Time Zone. The alert level is used for statistical classification in the Monitoring Alerts section of the Overview page. The alert message also displays the alert level of the metric.
NoteReal-time monitoring provides three levels: Red Alert (P0), Orange Alert (P1), and Normal Alert (P2). In this step, select the default level, Normal Alert (P2).
To configure multiple alert rules, repeat the steps above.
After you finish the configuration, click Submit. This completes the configuration of the custom monitoring product and generates a data source.