RUM Metric Detection¶
Current Document Scope
This document is the second step in the detection rule configuration process. After completing the configuration, return to the main document to continue to step 3: Event Notification.
Used to monitor Real User Monitoring (RUM) metric data in a workspace. It supports setting threshold ranges for performance metrics of multiple application types, including Web, Android, iOS, Mini Program (Miniapp), React Native, and HarmonyOS. When a metric exceeds the threshold, the system automatically triggers an alert.
This is suitable for scenarios that require frontend application performance monitoring. For example, you can monitor the JS error rate for Web by city dimension, or monitor the page load duration of a Mini Program, the crash rate of a mobile application, and so on.
Detection Configuration¶
Detection Frequency¶
Set the time interval for running detection.
-
Preset options: 1 minute, 5 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour
-
Default: 5 minutes
-
Crontab mode: Click "Switch to Crontab mode" to configure a custom interval. Scheduled task execution can be configured based on seconds, minutes, hours, days, months, weeks, and other intervals.
Detection Interval¶
Set the data time range queried for each detection (❗️The detection interval should be greater than or equal to the detection frequency and match the actual data reporting interval to avoid missed or false alerts).
| 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¶
Set the metric data to detect. You can configure application metric data for a single application type in the current workspace (❗️Avoid selecting high-cardinality fields as detection dimensions. Improper configuration and overly loose trigger conditions may cause frequent alerts. The maximum number of records returned by the current query is 100,000).
Configuration Elements¶
| Configuration Item | Description |
|---|---|
| Application Type | Application types supported by RUM, including: Web, Android, iOS, Miniapp, HarmonyOS |
| Application Name | Retrieve the corresponding application list based on the selected application type. You can select all applications or specific applications |
| Metric | Display the corresponding performance metrics based on the application type. See the metric descriptions below |
| Filter Conditions | Filter the detection metric data based on metric tags to limit the data scope. You can add one or more tag filters and use fuzzy match and fuzzy non-match filter conditions |
| Detection Dimensions | All corresponding string-type (keyword) fields in the configuration data can be selected as detection dimensions. Currently, up to three fields can be selected as detection dimensions. By combining multiple detection dimension fields, you can determine 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 you select host and host_ip as detection dimensions, the detection object can be {host: host1, host_ip: 127.0.0.1}.) |
| Additional Information | Additional fields are used only for extra queries and are not used to determine trigger conditions. You can configure them in event notifications. If multiple matching values are detected, one record is returned randomly |
Web / Mini Program Metrics¶
| Metric | DQL Query Example |
|---|---|
| JS Error Count | R::error:(count(__docid) asJS 错误数) { app_id = '<应用 ID>' } |
| JS Error Rate | Web: eval(A/B, alias='页面 JS 错误率', A="R::view:(count(view_url)) {view_error_count > 0, app_id = '<应用 ID>'}", B="R::view:(count(view_url)) { app_id = '<应用 ID>'}")Mini Program: eval(A/B, alias='JS 错误率', A="R::view:(count(view_name)) {view_error_count > 0, app_id = '<应用 ID>' }", B="R::view:(count(view_name)) { app_id = '<应用 ID>' }") |
| Resource Error Count | R::resource:(count(resource_url) as资源错误数) {resource_status >=400, app_id = '<应用 ID>'}" |
| Resource Error Rate | eval(A/B, alias='资源错误率', A="R::resource:(count(resource_url)) { resource_status >= '400',app_id = '<应用 ID>' }", B="R::resource:(count(resource_url)) { app_id = '<应用 ID>' }") |
| Average First Render Time | R::page:(avg(page_fpt)){app_id = '<应用 ID>'} |
| Average Page Load Duration | R::view:(avg(loading_time)){app_id = '<应用 ID>'} |
| Slow Page Load Count | R::resource:(count(resource_load)){app_id = '<应用 ID>',resource_load>8000000000,resource_type='document'}" |
| Average Resource Load Duration | R::resource:(avg(resource_load) as加载耗时) {app_id = '<应用 ID>',resource_type!='document'}" |
| LCP (largest_contentful_paint) | Supported aggregate functions: avg, percentileR::view:(avg(largest_contentful_paint)){app_id = '<应用 ID>'}R::view:(percentile(largest_contentful_paint,75)){app_id = '<应用 ID>'}R::view:(percentile(largest_contentful_paint,90)){app_id = '<应用 ID>'}R::view:(percentile(largest_contentful_paint,99)){app_id = '<应用 ID>'} |
| FID (first_input_delay) | Supported aggregate functions: avg, percentileR::view:(avg(first_input_delay)){app_id = '<应用 ID>'}R::view:(percentile(first_input_delay,75)){app_id = '<应用 ID>'}R::view:(percentile(first_input_delay,90)){app_id = '<应用 ID>'}R::view:(percentile(first_input_delay,99)){app_id = '<应用 ID>'} |
| CLS (cumulative_layout_shift) | Supported aggregate functions: avg, percentileR::view:(avg(cumulative_layout_shift)){app_id = '<应用 ID>'}R::view:(percentile(cumulative_layout_shift,75)){app_id = '<应用 ID>'}R::view:(percentile(cumulative_layout_shift,90)){app_id = '<应用 ID>'}R::view:(percentile(cumulative_layout_shift,99)){app_id = '<应用 ID>'} |
| FCP (first_contentful_paint) | Supported aggregate functions: avg, percentileR::view:(avg(first_contentful_paint)){app_id = '<应用 ID>'}R::view:(percentile(first_contentful_paint,75)){app_id = '<应用 ID>'}R::view:(percentile(first_contentful_paint,90)){app_id = '<应用 ID>'}R::view:(percentile(first_contentful_paint,99)){app_id = '<应用 ID>'} |
Android / iOS Metrics¶
| Metric | DQL Query Example |
|---|---|
| Startup Duration | R::action:(avg(duration)) { app_id = '<应用 ID>' ,action_type='app_cold_launch'}" |
| Total Crash Count | R::error:(count(error_type)) {app_id='<应用 ID>',error_source = 'logger' and is_web_view !='true'}" |
| Total Crash Rate | eval(A.a1/B.b1, alias='总崩溃率',A="R::error:(count(error_type) as a1) {app_id='<应用 ID>',error_source = 'logger',is_web_view !='true'} ",B="R::action:(count(action_name) as b1) { app_id = '<应用 ID>',action_type in [launch_cold,launch_hot,launch_warm]} ")" |
| Resource Error Count | R::resource:(count(resource_url) as资源错误数) {resource_status >=400, app_id = '<应用 ID>'}" |
| Resource Error Rate | eval(A/B, alias='资源错误率', A="R::resource:(count(resource_url)) { resource_status >= '400',app_id = '<应用 ID>' }", B="R::resource:(count(resource_url)) { app_id = '<应用 ID>' }") |
| Average FPS | R::view:(avg(fps_avg)) { app_id = '<应用 ID>' }" |
| Average Page Load Duration | R::view:(avg(loading_time)) { app_id = '<应用 ID>' }" |
| Average Resource Load Duration | R::resource:(avg(duration)) { app_id = '<应用 ID>' }" |
| Jank Count | R::long_task:(count(view_id)) { app_id = '<应用 ID>' }" |
| Page Error Rate | eval(A/B, alias='页面错误率',A="R::view:(count(view_name)) {view_error_count > 0, app_id = '<应用 ID>' }",B="R::view:(count(view_name)) { app_id = '<应用 ID>' }")" |
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, Warning, and a Normal recovery condition.
| Level | Configuration | Description |
|---|---|---|
| Fatal | When Result >= [value] |
Highest-level alert; handle immediately |
| Critical | When Result >= [value] |
High-level alert; handle with priority |
| Major | When Result >= [value] |
Medium-level alert; pay attention |
| Warning | When Result >= [value] |
Low-level alert; keep an eye on it |
| Normal | No event generated for [N] detections |
After the detection rule takes effect, if the data detection result recovers from an abnormal state (Fatal, Critical, Major, or Warning) to normal within the configured custom number of detections, a recovery alert event is triggered. ❗️ Recovery alert events are not subject to alert muting. If the number of detections for recovery alert events is not set, the alert event will not recover and will remain in Events > Unrecovered Events |
For more details, see Event Severity Levels.
Advanced Options¶
Consecutive Trigger Evaluation¶
When enabled, an event is generated only when the trigger condition is continuously met, avoiding false alerts caused by transient fluctuations (❗️The maximum configuration is 10 times).
High-Volume 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 summary-by-status strategy: it no longer processes alert objects one by one, but generates a small number of summary alerts based on event status and sends 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 after the monitor detects an anomaly will not display history or related events.
No Data¶
Handling strategy when the query result for the detection metric is empty within the detection interval:
| Option | Description |
|---|---|
| Do not trigger event (default) | Do not trigger an event when there is no data. This is suitable for scenarios where data gaps are allowed. |
| Treat query result as 0 | Treat empty data as 0 and continue to determine whether to generate an anomaly event based on the configured trigger conditions. |
| Trigger No Data event | Generate one No Data event for each round of no data for the same object. If data recovers and then becomes unavailable again, a new event can be generated. |
| Continuously trigger No Data events | When the same object continuously meets the no data condition, generate No Data events at the detection frequency until data recovers. For configuration details, see No Data. |
| Trigger Fatal event | Trigger a Fatal-level event when there is no data. |
| Trigger Critical event | Trigger a Critical-level event when there is no data. |
| Trigger Major event | Trigger a Major-level event when there is no data. |
| Trigger Warning event | Trigger a Warning-level event when there is no data. |
| Trigger recovery event | Trigger a recovery event when there is no data. |
After selecting an action for triggering events, enter the no data duration. It is recommended to set it to ≥ the detection interval. When both the no data condition and an anomaly condition are met, the system applies the no data handling result first.
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 the threshold is triggered, and finally determine whether to generate an information event.
Information Generation¶
After enabling this option, 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.
Subsequent Configuration¶
After completing the above detection configuration, continue with:
-
Event Notification: Define the event title, content, notification members, no data handling, and related incidents;
-
Alert Configuration: Select an alert policy, and set notification targets and mute periods;
-
Relate: Associate a dashboard for quick navigation to view data;
-
Permissions: Set operation permissions to control who can edit or delete this monitor.