Skip to content

Threshold Detection


Current Document Scope

This document is the second step in the detection rule configuration process. After configuration, return to the main document Continue to Step 3: Event Notification.

Data scope: supports all data types, such as metrics M, logs L, traces T, RUM data R, objects O, etc.).

Detection Configuration

Detection Frequency

Set the time period for executing detection.

  • Preset options: 1 minute, 5 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour

  • Crontab Mode: Click "Switch to Crontab Mode" to configure a custom schedule. Scheduled task execution can be configured based on seconds, minutes, hours, days, months, weeks, and other periods.

Detection Interval

Set the data time range queried by each detection (❗️The detection interval should be greater than or equal to the detection frequency and must match the actual data reporting interval to avoid missed detections or false positives).

  • Preset options:
Detection Frequency Detection Interval (drop-down options)
30s 1m/5m/15m/30m/1h/3h
1m 1m/5m/15m/30m/1h/3h
5m 5m/15m/30m/1h/3h
15m 15m/30m/1h/3h/6h
30m 30m/1h/3h/6h
1h 1h/3h/6h/12h/24h
6h 6h/12h/24h
12h 12h/24h
24h 24h
  • Custom format: Enter a custom detection interval, such as 20m (last 20 minutes), 2h (last 2 hours), or 1d (last 1 day).

Detection Metrics

Define the detection data source and aggregation method based on DQL.

Avoid selecting high-cardinality fields as detection dimensions. Improper configuration may make trigger conditions too permissive and cause frequent alerts. The current query returns a maximum of 100,000 records.

Configuration example: When configuring the detection metrics of a monitor, trace_id is selected as the group-by field.

The system will then prompt you:

The current grouping field trace_id is a high-cardinality risk field. Aggregating with such fields generates a massive number of groups, which can easily cause an alert storm and cause the monitor to be automatically paused by the system. Optimize the grouping settings.

Configuration Elements

Configuration Item Description
Workspace Defaults to the current workspace; you can switch to other authorized workspaces.

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 metrics drop-down list displays only the data types that the current workspace is authorized to use.
Data Source Type Metrics, logs, traces, RUM data, etc.
Query Mode Simple query, expression query, PromQL query, data source query
Filters Filter detection objects by tags
Aggregation avg, sum, max, min, count, etc.
Function Support Click the fx button to select the following functions:

  • Label filtering: filter or group by label values
  • Conversion functions: data type conversion or format conversion
  • Selection functions: first, last, max, min
  • No-data filling: previous value fill, linear fill, numeric fill

    ❗️When selecting the conversion functions derivative, difference, non_negative_derivative, or non_negative_difference, you need to add interval. For example: [::5m]
  • Click to view Query Mode Details and More Information on Using Functions.

    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—Critical, Major, Minor, and Warning—as well as a Normal recovery condition.

    Level Configuration Description
    Critical When Result >= [value] Highest-level alert; requires immediate action
    Major When Result >= [value] High-level alert; requires priority handling
    Minor When Result >= [value] Medium-level alert; requires attention
    Warning When Result >= [value] Low-level alert; keep an eye on it
    Normal No event is generated for [N] consecutive detections If the detection metric triggers a "Critical", "Major", "Minor", or "Warning" anomaly event, and the next N consecutive detections are normal, a "Normal" event is generated. Used to determine whether an anomaly event has recovered. Recommended.

    For more details, see Event Level Description.

    Advanced Options

    Consecutive Trigger Evaluation

    When enabled, an event is generated only when the trigger condition is continuously met, avoiding false alerts caused by momentary fluctuations (❗️maximum configuration limit: 10 times).

    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 aggregation strategy: instead of processing alert objects one by one, it generates a small number of summary alerts based on event status and pushes them.

    This ensures timely notifications while significantly reducing alert noise and avoiding timeout risks caused by processing too many alerts.

    When this switch is enabled, such Event Details generated by subsequent monitor detections of anomalies will not display history records or related events.

    Recovery Conditions

    Configure recovery conditions and severity levels. When the query result contains multiple values, a recovery event is generated if any value meets the trigger condition.

    Set independent recovery thresholds for different levels to implement downgraded recovery. For example, a Major alert recovers when the value drops below 70, while a Minor alert recovers when the value drops below 80.

    Alert Recovery Logic

    After "Recovery Conditions" is enabled, the system uses the Fault ID as a unique identifier to manage the entire alert lifecycle (including operations such as creating Issues).

    When the tiered recovery feature is also enabled:

    • The platform configures a separate set of recovery rules (that is, recovery thresholds) for each alert level (for example, critical, warning).

    • The alert status and recovery status of each level are calculated independently.

    • This does not affect the alert lifecycle identified by the original Fault ID.

    Therefore, when a monitor triggers an alert for the first time (that is, starts a new alert lifecycle), the system generates two alert messages at the same time. They appear identical because:

    1. The first alert source: overall detection (check), representing the start of the entire fault lifecycle (based on the original rule);

    2. The second alert source: tiered detection (critical/error/warning/…), indicating that the enabled tiered recovery feature has started. It is used to present the specific alert level and its subsequent recovery status (such as critical_ok).

    In the above, the df_monitor_checker_sub field is the key basis for distinguishing the two types of alerts:

    • check: indicates the result of overall detection;

    • Other values (such as critical, error, warning, etc.): correspond to the results of tiered detection rules.

    Therefore, when an alert is triggered for the first time, two records appear. Their content is similar, but their sources and purposes are different.

    df_monitor_checker_sub T+0 T+1 T+2 T+3
    check check error warning ok
    critical critical critical_ok
    error error error_ok
    warning warning warning_ok

    No Data

    Handling strategy when the query result for the detection metric is empty within the detection interval:

    Option Description
    Do not trigger an event (default) No alert is generated when there is no data. This applies to scenarios where missing data is acceptable.
    Treat query result as 0 Treat empty data as 0 for threshold evaluation.
    Trigger a no-data event For the same object, one no-data event is generated per round of missing data. After recovery, if data becomes missing again, a new event can be generated.
    Continuously trigger no-data events When the same object continuously meets the no-data condition, no-data events are generated at the detection frequency until data recovers. For configuration, see No Data.
    Trigger a Critical event Trigger a Critical-level event when there is no data.
    Trigger a Major event Trigger a Major-level event when there is no data.
    Trigger a Minor event Trigger a Minor-level event when there is no data.
    Trigger a Warning event Trigger a Warning-level event when there is no data.
    Trigger a Recovery event Trigger a Recovery event when there is no data.

    When trigger conditions, no data, and information generation are configured at the same time, the trigger priority is as follows: No Data > Trigger Conditions > Information Event Generation.

    That is, first determine whether data is missing, then determine whether a threshold is triggered, and finally determine whether to generate an information event.

    Information Generation

    After this option is enabled, you need to configure Information Generation Conditions. The system writes an "Information" event only when the detection result does not trigger any of the "Critical", "Major", "Minor", or "Warning" thresholds and meets the information generation conditions.

    This applies to scenarios where normal status changes or low-priority information need to be recorded.

    Subsequent Configuration

    After completing the above detection configuration, continue with:

    1. Event Notification: Define the event title, content, notification members, no-data handling, and associated incidents;

    2. Alert Configuration: Select an alert policy and set notification targets and mute periods;

    3. Associations: Associate a dashboard for quick navigation to view data;

    4. Permissions: Set operation permissions to control who can edit or delete this monitor.