Web Application Data Collection¶
After application data is collected into Guance, you can use the Guance console to customize scenarios and configure anomaly detection events.
Data Types¶
Real User Monitoring (RUM) in Guance includes six data types:
| Type | Description |
|---|---|
| session | User session information record. Within the current session, captures session-dimension access data related to user pages, resources, actions, errors, and long tasks. |
| view | Each time a user visits a page, a page view record is generated. While the user stays on the same page, resource, long task, error, and action records are linked to the related RUM view through the view_id attribute. |
| resource | Information record of resources loaded when a user visits a page. |
| error | The RUM collector collects all frontend errors in the browser. |
| long_task | For any task in the browser that blocks the main thread for more than 50 ms, a long task record is generated. |
| action | Tracks all user interaction records during user page browsing. |
Global Attributes¶
RUM scenarios and event alerts can both be queried through the following global attributes.
SDK Attributes¶
| Field | Type | Description |
|---|---|---|
sdk_name |
string | Collector name. Fixed names:df_web_rum_sdkdf_miniapp_rum_sdkdf_ios_rum_sdkdf_android_rum_sdk |
sdk_version |
string | Collector version information. |
Application Attributes¶
| Field | Type | Description |
|---|---|---|
app_id |
string | Required. Unique ID of the RUM application, automatically generated when a monitor is created in the Guance console. |
env |
string | Required. Environment field. Attribute values: prod/gray/pre/common/local. Where: prod: production environment; gray: gray environment; pre: pre-release environment; common: daily environment; local: local environment. |
version |
string | Required. Version number. |
service |
string | Required. Value corresponding to the service field configured in the RUM SDK. |
User & Session Attributes¶
| Field | Type | Description |
|---|---|---|
userid |
string | By default, the browser Cookie is obtained as userid. If Custom User ID is used to set the user ID, userid remains consistent with the defined value.❗️ Cookie expiration time is 60 days. |
session_id |
string | Session ID (a user session expires if no interaction occurs within 15 minutes). |
session_type |
string | Session type. Reference values: user & synthetics: |
is_signin |
boolean | Whether the user is a registered user. Attribute values: True / False. |
Device & Resolution Attributes¶
| Field | Type | Description |
|---|---|---|
os |
string | Operating system |
os_version |
string | Operating system version |
os_version_major |
string | Major operating system version reported by the device |
browser |
string | Browser vendor |
browser_version |
string | Browser version |
browser_version_major |
string | Browser major version information |
screen_size |
string | Screen width*height, resolution |
Windows Version Identification
When the browser provides User-Agent Client Hints, the SDK uses platformVersion to distinguish Windows 10 from Windows 11. For browsers that do not support this capability, refuse to return high-entropy values, or time out during the query, the SDK continues to use navigator.userAgent. Because the traditional User-Agent for Windows 11 still reports Windows NT 10.0, Windows 10 and Windows 11 cannot be distinguished in this case.
Geographic & Network Attributes¶
| Field | Type | Description |
|---|---|---|
ip |
string | User access IP address |
isp |
string | ISP |
network_type |
string | Network connection type. Reference attribute values:wifi | 2g | 3g | 4g | 5g | unknown (unknown network) | unreachable (network unavailable) |
country |
string | Country |
country_iso_code |
string | Country iso_code |
province |
string | Province |
city |
string | City |
Custom Attributes¶
In addition to global attributes, you can also use custom attributes (the SDK supports user-defined tag data) to build scenarios and configure event alerts. Custom attributes are non-global attributes. With custom attributes, you can track the entire process of users visiting the application, locate and discover affected user visits, and monitor user visit performance.
Attributes of Other Data Types¶
Session¶
Attributes¶
| Field | Type | Description |
|---|---|---|
session_id |
string | Session ID (a user session expires if no interaction occurs within 15 minutes) |
session_type |
string | Session type. Reference values: user & synthetics: |
session_first_view_id |
string | view_id of the first page in the current session |
session_first_view_url |
string | URL of the first page in the current session |
session_first_view_host |
string | Domain of the first page in the current session |
session_first_view_path |
string | Address of the first page in the current session |
session_first_view_path_group |
string | Address group of the first page in the current session |
session_first_view_url_query |
string | Query information of the first page in the current session |
session_first_view_name |
string | Address group of the first page in the current session, same as the session_first_view_path_group field |
session_last_view_id |
string | view_id of the last visited page in the current session |
session_last_view_url |
string | URL of the last page in the current session |
session_last_view_host |
string | Domain of the last page in the current session |
session_last_view_path |
string | Address of the last page in the current session |
session_last_view_path_group |
string | Address group of the last page in the current session |
session_last_view_url_query |
object | Query information of the last page in the current session |
session_last_view_name |
string | Address group of the last page in the current session, same as the session_last_view_path_group field |
Statistical Metrics¶
| Field | Type | Description |
|---|---|---|
time_spent |
number(ns) | Duration of the current session |
session_time_spent_count |
number | Counted in 4-hour intervals; each additional 4 hours adds 1 |
session_view_count |
number | Number of view_id values associated with the current session |
session_error_count |
number | Number of errors generated by the current session |
session_resource_count |
number | Number of resources loaded in the current session |
session_action_count |
number | Number of user actions in the current session |
session_long_task_count |
number | Number of long tasks generated in the current session |
View¶
Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited |
view_loading_type |
string | Page load type. Reference values: initial_load, route_change; route_change is the SPA page load mode |
view_navigation_type |
string | SPA route navigation type provided starting with RUM SDK 3.3.9. Reference values: push, replace, traverse. When the browser supports the Soft Navigation API, the native value is preferred; otherwise, it is generated through Navigation API, History API, or Hash routing compatibility logic. It exists only in route_change Views where the navigation source can be identified |
view_referrer |
string | Page referrer |
view_url |
string | Page URL |
view_host |
string | Domain part of the page URL |
view_path |
string | Path part of the page URL |
view_path_group |
string | Page URL path group |
view_url_query |
string | Query part of the page URL |
session_has_replay |
boolean | Whether the session to which the current View belongs has already generated Session Replay data that can be associated |
Metrics¶
| Metric | Type (Unit) | Description |
|---|---|---|
loading_time |
number(ns) | The page is ready and there are no network requests or DOM changes. For details, see Page Loading Time |
largest_contentful_paint |
number(ns) | LCP reports the render time of the largest image or text block visible in the viewport. For the initial load, the starting point is page navigation; starting with RUM SDK 3.3.9, when the Chrome Soft Navigation API is supported, SPA route changes use the corresponding soft navigation as the starting point. To provide a good user experience, LCP should occur within 2.5 seconds. |
largest_contentful_paint_element_selector |
string | Selector of the element corresponding to the LCP metric; may exist for both initial loads and SPA route changes that support the native Soft Navigation API |
cumulative_layout_shift |
number | Cumulative Layout Shift, measures visual stability. To provide a good user experience, the page's CLS should remain at 0.1 or less. |
cumulative_layout_shift_target_selector |
string | Selector of the element corresponding to the CLS metric |
first_input_delay |
number(ns) | Measures the input delay of the first interaction on the page; Core Web Vitals currently uses INP instead of FID |
first_input_time |
number(ns) | Time of the first interaction relative to the start of the current View |
first_input_target_selector |
string | Selector of the element that produced the first interaction |
interaction_to_next_paint |
number(ns) | Measures the page's overall responsiveness to user interactions throughout the visit, including input delay, event processing, and next-frame rendering time |
interaction_to_next_paint_target_selector |
string | Selector of the interactive element that produces the INP metric |
first_contentful_paint |
number(ns) | The First Contentful Paint (FCP) metric measures the time from the start of the initial load or an SPA route change that supports the Chrome Soft Navigation API until any part of the page content finishes rendering on the screen; SPA route change metrics are available starting with RUM SDK 3.3.9. For this metric, "content" refers to text, images (including background images), <svg> elements, or non-white <canvas> elements. See w3c |
first_byte |
number(ns) | Time from requesting the page to the first byte of the page response |
dom_interactive |
number(ns) | Time when the parser finishes parsing the document. For details, see MDN |
dom_content_loaded |
number(ns) | The DOMContentLoaded event is fired when the pure HTML has been completely loaded and parsed, without waiting for stylesheets, images, or subframes to finish loading. For details, see MDN |
dom_complete |
number(ns) | The page and all subresources are ready. For users, the loading animation has stopped spinning. For details, see MDN |
load_event |
number(ns) | Fired when the entire page and all dependent resources, such as stylesheets and images, have finished loading. It differs from DOMContentLoaded, which fires as soon as the page DOM has loaded without waiting for dependent resources to load. For details, see MDN |
first_paint_time |
number(ns) | Document response phase duration calculated by the current SDK Calculation: responseEnd - fetchStart |
resource_load_time |
number(ns) | Resource load time Calculation: loadEventStart - domContentLoadedEventEnd |
time_to_interactive |
number(ns) | Time to interactive Calculation: domInteractive - fetchStart |
dom |
number(ns) | DOM parsing duration Calculation: domComplete - domInteractive |
dom_ready |
number(ns) | DOM Ready time Calculation: domContentLoadedEventEnd - fetchStart |
time_spent |
number(ns) | Page dwell time |
is_active |
boolean | Whether the user is still active. Reference values: true & false |
Statistical Metrics¶
| Field | Type | Description |
|---|---|---|
view_error_count |
number | Number of errors occurring during each page load |
view_resource_count |
number | Number of resources requested during each page load |
view_long_task_count |
number | Number of long tasks generated during each page load |
view_action_count |
number | Number of actions during page views |
frustration_count |
number | Number of frustration behaviors associated with the current View |
view_apdex_level |
number | Page Apdex satisfaction. Base metric: first_paint_time (converted to seconds)Reference values: 0/1/2/3/4/5/6/7/8/9 (based on the first_paint_time value; 9 means >= 9 seconds) |
Resource¶
In addition to page resources, XHR, and fetch, after experimental features are enabled, native WebSocket connections also generate a Resource with resource_type = websocket. WebSocket has no HTTP response, so it does not include resource_status, resource_method, or HTTP timing; for connection, message, and close fields, see WebSocket Persistent Connection Collection.
View Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited |
is_active |
boolean | Whether the user is still active. Reference values: true | false |
view_loading_type |
string | Page load type. Reference values: initial_load |
view_referrer |
string | Page referrer |
view_url |
string | Page URL |
view_host |
string | Domain part of the page URL |
view_path |
string | Path part of the page URL |
view_path_group |
string | Page URL path group |
view_url_query |
string | Query part of the page URL |
Resource Attributes¶
| Field | Type | Description |
|---|---|---|
resource_url |
string | Resource URL |
resource_url_host |
string | Domain part of the resource URL |
resource_url_path |
string | Path part of the resource URL |
resource_url_query |
string | Query part of the resource URL |
resource_url_path_group |
string | Resource URL path group |
resource_type |
string | Resource type |
resource_method |
string | Resource request method |
resource_status |
string | Status value returned by the resource request |
resource_status_group |
string | Status group value returned by the resource request |
resource_duration_source |
string | Source of the Fetch event duration; see the description below. |
Metrics¶
| Field | Type | Description |
|---|---|---|
resource_size |
number | Resource size. Default unit: byte |
resource_dns |
number(ns) | DNS resolution time for resource loading Calculation: domainLookupEnd - domainLookupStart |
resource_tcp |
number(ns) | TCP connection time for resource loading Calculation: connectEnd - connectStart |
resource_ssl |
number(ns) | SSL connection time for resource loading Calculation: connectEnd - secureConnectStart |
resource_ttfb |
number(ns) | Request response time for resource loading Calculation: responseStart - requestStart |
resource_trans |
number(ns) | Content transfer time for resource loading Calculation: responseEnd - responseStart |
resource_first_byte |
number(ns) | First byte time for resource loading Calculation: responseStart - domainLookupStart |
duration |
number(ns) | Resource load duration. For Fetch, the timing method can be distinguished by resource_duration_source. |
Fetch Resource Duration¶
Starting with Browser SDK 3.3.25, each Fetch generates at most one Resource event. resource_duration_source indicates the timing method for duration, in nanoseconds.
resource_timing— resource load duration measured by the browser, including response download.fetch_settled— duration from calling Fetch until its Promise fulfills or rejects.
The SDK reports only the network phases and byte counts that the browser can provide. On a cache hit, the transfer size can be 0. When cross-origin permissions are restricted or concurrent requests to the same URL cannot be distinguished, unknown fields are left empty. Application code can read or cancel the response body as usual.
Error¶
View Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited |
is_active |
boolean | Whether the user is still active. Reference values: true | false |
view_loading_type |
string | Page load type. Reference values: initial_load |
view_referrer |
string | Page referrer |
view_url |
string | Page URL |
view_host |
string | Domain part of the page URL |
view_path |
string | Path part of the page URL |
view_path_group |
string | Page URL path group |
view_url_query |
string | Query part of the page URL |
Error Attributes¶
| Field | Type | Description |
|---|---|---|
error_source |
string | Error source. Reference values: console | network | source | custom |
error_type |
string | Error type. Reference link: error type |
resource_status |
string | Status value returned by the resource request |
resource_url |
string | Resource URL |
resource_url_host |
string | Domain part of the resource URL |
resource_url_path |
string | Path part of the resource URL |
resource_url_path_group |
string | Resource URL path group |
resource_method |
string | Resource request method |
Metrics¶
| Field | Type | Description |
|---|---|---|
error_message |
string | Error message |
error_stack |
string | Error stack |
Long Task¶
View Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited |
is_active |
boolean | Whether the user is still active. Reference values: true | false |
view_loading_type |
string | Page load type. Reference values: initial_load |
view_referrer |
string | Page referrer |
view_url |
string | Page URL |
view_host |
string | Domain part of the page URL |
view_path |
string | Path part of the page URL |
view_path_group |
string | Page URL path group |
view_url_query |
string | Query part of the page URL |
Metrics¶
| Field | Type | Description |
|---|---|---|
duration |
number(ns) | Time spent on long tasks generated during page load |
Action¶
View Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited |
is_active |
boolean | Whether the user is still active. Reference values: true | false |
view_loading_type |
string | Page load type. Reference values: initial_load |
view_referrer |
string | Page referrer |
view_url |
string | Page URL |
view_host |
string | Domain part of the page URL |
view_path |
string | Path part of the page URL |
view_path_group |
string | Page URL path group |
view_url_query |
string | Query part of the page URL |
Action Attributes¶
| Field | Type | Description |
|---|---|---|
action_id |
string | Unique ID generated when a user performs a page action |
action_name |
string | Action name |
action_type |
string | Action type |
Metrics¶
| Field | Type | Description |
|---|---|---|
duration |
number(ns) | Time spent on page actions |
Statistical Metrics¶
| Field | Type | Description |
|---|---|---|
action_long_task_count |
number | Number of long tasks associated with the action |
action_resource_count |
number | Number of resource requests associated with the action |
action_error_count |
number | Number of errors associated with the action |
