Change Detection¶
Current Document Scope
This document is the second step in the detection rule configuration process. After configuration is complete, return to the main document Continue to Step 3: Event Notifications.
By comparing the absolute change or relative percentage change of the same metric across two different time ranges, you can determine whether an anomaly has occurred. This method is commonly used to track metric peaks or fluctuations. When an anomaly is detected, event records can be generated more precisely for subsequent analysis and handling.
It is suitable for monitoring relative changes or rates of change between short-term and long-term data. For example, if the MySQL connection count metric is configured so that the percentage difference between the average value over the last 15 minutes and the average value over the past day is greater than 500%, this means that if the average connection count over the last 15 minutes exceeds 5 times the average connection count over the past day, the system triggers an alert.
It is recommended to use statistical functions such as average (avg), maximum (max), and minimum (min) to calculate these metrics instead of the last value (last) function, so as to reduce the impact of anomalous data and improve monitoring accuracy.
Detection Metric¶
Define the detection data source and aggregation method based on DQL (❗️Avoid selecting high-cardinality fields as detection dimensions. If configured improperly and trigger conditions are too loose, frequent alerts may be triggered. The current query returns a maximum of 100,000 records).
Detect change anomalies by comparing metric data from two time ranges:
Result = the [difference/difference percentage] of the detection metric between [Time Range A] and [Time Range B]
Configuration Elements¶
| Configuration Item | Description |
|---|---|
| Workspace | Defaults to the current Workspace; you can switch to another authorized Workspace. After authorization, you can use detection metrics from other Workspaces under the current account to create Monitors. Once the rule is created, cross-Workspace alert configuration is enabled. Note that when you select another Workspace, the detection metric drop-down list displays only the data types that the selected Workspace has been authorized to use. |
| Data Source Type | Metrics, logs, traces, RUM data, etc. |
| Query Method | Simple Query, Expression Query |
| Filters | Filter the detection metric data based on metric tags to limit the data range for detection; supports adding one or more tag filters; supports fuzzy match and fuzzy non-match filter conditions |
| Aggregation Method | Avg by (average value), Min by (minimum value), Max by (maximum value), Sum by (sum), Last (last value), First by (first value), Count by (number of data points), Count_distinct by (number of distinct data points), p50 (median value), p75 (value at the 75th percentile), p90 (value at the 90th percentile), p99 (value at the 99th percentile) |
| Detection Dimension | String (keyword) fields in the configured data can all be selected as detection dimensions. Currently, up to three fields can be selected as detection dimensions. By combining multiple detection dimension fields, you can identify a specific detection object. The system determines whether the statistical metric corresponding to a detection object meets the trigger condition threshold and generates an event if it does.(For example, if detection dimensions host and host_ip are selected, the detection object can be {host: host1, host_ip: 127.0.0.1}.) |
| Alias | Custom detection metric name |
Time Range Configuration¶
| Configuration Item | Description |
|---|---|
| Time Range A | Recent data time range used as the baseline |
| Time Range B | Historical data time range used for comparison |
| Comparison Method | Difference: absolute difference between the two time ranges (A - B) Difference Percentage: relative change percentage ((A - B) / B × 100%) |
- Available Time Ranges:
| Time Range Type | Options |
|---|---|
| Historical Same Period | Last Month, Last Week, Yesterday, 1 Hour Ago, Previous Period, Last 15 Minutes, Last 30 Minutes, Last 1 Hour, Last 4 Hours, Last 12 Hours, Last 1 Day |
| Recent Time | Last 1 Minute, Last 5 Minutes, Last 15 Minutes, Last 30 Minutes, Last 1 Hour, Last 4 Hours, Last 12 Hours, Last 1 Day |
Note
The detection ranges "Yesterday" and "1 Hour Ago" compare the difference or difference percentage of the detection metric within the same time range; other detection ranges compare the difference or difference percentage of the detection metric between two different time ranges.
Click to view Query Method Details.
Detection Frequency¶
The execution frequency of the detection rule. It automatically matches the detection range with the larger time span among the two selected detection ranges.
- Default: 5 minutes
Trigger Conditions¶
Configure trigger conditions and severity levels. When the query result contains multiple values, an event is generated if any value meets the trigger condition.
You can configure four threshold levels: Fatal, Critical, Major, and Warning, as well as the Normal recovery condition.
| Level | Configuration | Description |
|---|---|---|
| Fatal | When Result >= [value] |
Highest-level alert; requires immediate action |
| Critical | When Result >= [value] |
High-level alert; requires priority handling |
| Major | When Result >= [value] |
Medium-level alert; requires attention |
| Warning | When Result >= [value] |
Low-level alert; requires monitoring |
| Normal | No event generated for [N] consecutive detections |
After the detection rule takes effect, if the data detection result recovers from an abnormal state (Fatal, Critical, Major, Warning) to Normal within the configured custom detection count, a recovery alert event is triggered. ❗️ Recovery alert events are not subject to Alert Muting. If the detection count for recovery alert events is not set, the alert event will not recover and will remain in Events > Unrecovered Events list |
For more details, see Event Severity Levels.
Preconditions for Triggering¶
Enabled by default. This serves as the entry threshold for change detection. The change detection rule is evaluated only when the detected value meets the threshold set in the precondition.
- Configuration format: The following evaluation is performed only when the detection value of
[Time Range][operator][threshold] - Supported operators:
>,>=,<,<=(defaults to>) - If this option is disabled, the system directly evaluates the change detection rule without an entry threshold.
Change Direction¶
An event is triggered when the change direction is [direction]:
- Up: Detects an upward (increase) change in data
- Down: Detects a downward (decrease) change in data
- Up or Down: Detects a change in either direction (increase or decrease)
Bulk Alert Protection¶
Enabled by default.
When the number of alerts generated by a single detection exceeds the preset threshold, the system automatically switches to a status-based summary strategy: it no longer processes alert objects one by one, but generates and pushes a small number of summary alerts based on event status.
This ensures notification timeliness while significantly reducing alert noise and avoiding timeout risks caused by handling too many alerts.
When this switch is enabled, such Event Details generated after subsequent Monitors detect anomalies will not display history or associated events.
No Data¶
Handling strategy when the query result for the detection metric is empty within the detection range:
| Option | Description |
|---|---|
| Do not trigger event (default) | Does not trigger an event when there is no data; suitable for scenarios where data absence is allowed. |
| Treat query result as 0 | Treats empty data as 0 and continues to determine whether to generate an anomaly event according to the configured trigger conditions. |
| Trigger No Data event | For the same object, generates one No Data event per round of data absence; after recovery, a new event can be generated if data becomes absent again. |
| Continuously trigger No Data event | When the same object continuously meets the no-data condition, generates No Data events at the detection frequency until data recovers. For configuration details, see No Data. |
| Trigger Fatal event | Triggers a Fatal-level event when there is no data. |
| Trigger Critical event | Triggers a Critical-level event when there is no data. |
| Trigger Major event | Triggers a Major-level event when there is no data. |
| Trigger Warning event | Triggers a Warning-level event when there is no data. |
| Trigger Recovery event | Triggers a Recovery event when there is no data. |
After selecting an event-triggering action, enter the no-data duration. It is recommended to set it to ≥ 2x the detection frequency.
When trigger conditions, No Data, and information generation are configured at the same time, the triggering priority is as follows: No Data > Trigger Conditions > Information Event Generation.
That is, first determine whether data is missing, then whether the threshold is triggered, and finally whether to generate an information event.
Information Generation¶
After this option is enabled, you must configure information generation conditions. The system writes an Information event only when the detection result does not trigger any of the Fatal, Critical, Major, or Warning thresholds and meets the information generation conditions.
This is suitable for scenarios where normal state changes or low-priority information need to be recorded.
Next Steps¶
After completing the detection configuration above, proceed to configure:
-
Event Notifications: Define the event title, content, notification members, No Data handling, and associated Incidents;
-
Alert Configuration: Select an Alert Policy and set Notification Targets and the Mute period;
-
Relate: Associate a dashboard for quick navigation to view data;
-
Permissions: Set operation permissions to control who can edit/delete this Monitor.