Web Application Data Collection¶
After application data is collected into TrueWatch, you can use the TrueWatch console to customize scenarios and configure anomaly detection events.
Data Types¶
TrueWatch Real User Monitoring (RUM) includes six data types:
| Type | Description |
|---|---|
| session | Records user session information. In the current session, it captures page, resource, action, error, and long task access data based on the session dimension. |
| view | A page view record is generated each time a user visits a page. While the user stays on the same page, resource, long task, error, and action records are linked to the associated RUM view via the view_id attribute. |
| resource | Records resource information loaded when a user visits a page. |
| error | The RUM collector collects all frontend errors on the browser. |
| long_task | For any task that blocks the main thread for more than 50ms in the browser, a long task record is generated. |
| action | Tracks all user interaction records during page browsing. |
Global Attributes¶
You can query the following global attributes for scenario building and event alerting in RUM.
SDK Attributes¶
| Field | Type | Description |
|---|---|---|
sdk_name |
string | Collector name, fixed values: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. The unique ID of the RUM application, automatically generated when you create a monitor in the TrueWatch console. |
env |
string | Required. Environment field. Attribute values: prod/gray/pre/common/local. Where: prod: production environment; gray: canary environment; pre: pre-release environment; common: daily environment; local: local environment. |
version |
string | Required. Version number. |
service |
string | Required. The value of the service field configured in the RUM SDK. |
User & Session Attributes¶
| Field | Type | Description |
|---|---|---|
userid |
string | Default: uses the browser cookie as userid. If you set a user ID using custom user identification, then userid will match that definition.❗️ Cookie expiration: 60 days. |
session_id |
string | Session ID (a session expires if no user 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 OS version reported by the device |
browser |
string | Browser provider |
browser_version |
string | Browser version |
browser_version_major |
string | Major browser version |
screen_size |
string | Screen width * height, resolution |
Windows System Version Identification
When the browser provides User-Agent Client Hints, the SDK will distinguish between Windows 10 and Windows 11 using platformVersion. For browsers that do not support this capability, refuse to return high-entropy values, or time out, the SDK continues to use navigator.userAgent. Since the traditional User-Agent for Windows 11 still reports Windows NT 10.0, it is not possible to distinguish Windows 10 from Windows 11 in such cases.
Geo & Network Attributes¶
| Field | Type | Description |
|---|---|---|
ip |
string | User access IP address |
isp |
string | Internet service provider |
network_type |
string | Network connection type. Reference values:wifi | 2g | 3g | 4g | 5g | unknown (unknown network) | unreachable (network unreachable) |
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 custom tags) to build scenarios and configure event alerts. Custom attributes are non-global attributes. With custom attributes, you can track the entire process of user application access, locate and identify affected user access, and monitor user access performance.
Other Data Type Attributes¶
Session¶
Attributes¶
| Field | Type | Description |
|---|---|---|
session_id |
string | Session ID (a session expires if no user interaction occurs within 15 minutes). |
session_type |
string | Session type. Reference values: user & synthetics: |
session_first_view_id |
string | The 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 | Hostname of the first page in the current session. |
session_first_view_path |
string | Path of the first page in the current session. |
session_first_view_path_group |
string | Path 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 | Path 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 page visited in the current session. |
session_last_view_url |
string | URL of the last page in the current session. |
session_last_view_host |
string | Hostname of the last page in the current session. |
session_last_view_path |
string | Path of the last page in the current session. |
session_last_view_path_group |
string | Path 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 | Path group of the last page in the current session, same as the session_last_view_path_group field. |
Metrics¶
| Field | Type | Description |
|---|---|---|
time_spent |
number(ns) | Duration of the current session. |
session_time_spent_count |
number | Counted by adding 1 for every 4-hour interval beyond the first 4-hour block. |
session_view_count |
number | Number of view_id entries associated with the current session. |
session_error_count |
number | Number of errors generated in 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 loading type. Reference values: initial_load, route_change. route_change is the loading mode for SPA pages. |
view_navigation_type |
string | SPA route navigation type provided since RUM SDK 3.3.9. Reference values: push, replace, traverse. When the browser supports the Soft Navigation API, the native value is used; otherwise, it is generated through Navigation API, History API, or hash route compatibility logic. Only present in route_change views where the navigation source can be identified. |
view_referrer |
string | Page referrer (source). |
view_url |
string | Page URL. |
view_host |
string | Hostname part of the page URL. |
view_path |
string | Path part of the page URL. |
view_path_group |
string | Path group of the page URL. |
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 associable session replay data. |
Metrics¶
| Metric | Type (Unit) | Description |
|---|---|---|
loading_time |
number(ns) | The time when the page is ready, with no network requests or DOM changes. See Page Loading Time for details. |
largest_contentful_paint |
number(ns) | LCP reports the render time of the largest image or text block visible in the viewport. For initial load, the start point is the page navigation; since RUM SDK 3.3.9, when the Chrome Soft Navigation API is supported, the start point is the corresponding soft navigation for SPA route changes. For a good user experience, LCP should occur within 2.5 seconds. |
largest_contentful_paint_element_selector |
string | The selector of the element that produced the LCP metric. It may exist for initial load and for SPA route changes that support the native Soft Navigation API. |
cumulative_layout_shift |
number | Measures visual stability. For a good user experience, the page CLS should be 0.1 or less. |
cumulative_layout_shift_target_selector |
string | The selector of the element that produced the CLS metric. |
first_input_delay |
number(ns) | Measures the input delay of the first page interaction. The current Core Web Vitals have replaced FID with INP. |
first_input_time |
number(ns) | The time of the first interaction relative to the start of the current View. |
first_input_target_selector |
string | The selector of the element that produced the first interaction. |
interaction_to_next_paint |
number(ns) | Measures the overall responsiveness of a page to user interactions throughout the visit, including input delay, event processing, and next frame paint time. |
interaction_to_next_paint_target_selector |
string | The selector of the interaction element that produced the INP metric. |
first_contentful_paint |
number(ns) | The First Contentful Paint (FCP) metric measures the time when any part of the page content is rendered on the screen, starting from the initial load or from the start of an SPA route change that supports the Chrome Soft Navigation API. SPA route change metrics are available since 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 receiving the first byte of the page response. |
dom_interactive |
number(ns) | Time when the parser finishes parsing the document. See MDN for details. |
dom_content_loaded |
number(ns) | The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. See MDN for details. |
dom_complete |
number(ns) | The page and all subresources are ready. For the user, the loading animation has stopped spinning. See MDN for details. |
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 is loaded, without waiting for dependent resources. See MDN for details. |
first_paint_time |
number(ns) | The time calculated by the current SDK for the document response phase. Calculation: responseEnd - fetchStart. |
resource_load_time |
number(ns) | Resource load time. Calculation: loadEventStart - domContentLoadedEventEnd. |
time_to_interactive |
number(ns) | Time to first interactive. Calculation: domInteractive - fetchStart. |
dom |
number(ns) | DOM parsing time. Calculation: domComplete - domInteractive. |
dom_ready |
number(ns) | DOM Ready time. Calculation: domContentLoadedEventEnd - fetchStart. |
time_spent |
number(ns) | Time spent on the page. |
is_active |
boolean | Determines whether the user is still active. Reference values: true & false. |
Statistics¶
| Field | Type | Description |
|---|---|---|
view_error_count |
number | Number of errors that occurred 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 performed during the page view. |
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 first_paint_time value, 9 means >= 9 seconds). |
Resource¶
In addition to page resources, XHR, and fetch, when the experimental feature is 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. See WebSocket Long Connection Collection for connection, message, and close fields.
View Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited. |
is_active |
boolean | Determines whether the user is still active. Reference values: true | false. |
view_loading_type |
string | Page loading type. Reference value: initial_load. |
view_referrer |
string | Page referrer (source). |
view_url |
string | Page URL. |
view_host |
string | Hostname part of the page URL. |
view_path |
string | Path part of the page URL. |
view_path_group |
string | Path group of the page URL. |
view_url_query |
string | Query part of the page URL. |
Resource Attributes¶
| Field | Type | Description |
|---|---|---|
resource_url |
string | Resource URL. |
resource_url_host |
string | Hostname 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 | Path group of the resource URL. |
resource_type |
string | Resource type. |
resource_method |
string | Resource request method. |
resource_status |
string | Resource request status code. |
resource_status_group |
string | Resource request status group. |
Metrics¶
| Field | Type | Description |
|---|---|---|
resource_size |
number | Resource size. Default unit: bytes. |
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) | Time to first byte 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 time. Calculation: duration(responseEnd - startTime). |
Error¶
View Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited. |
is_active |
boolean | Determines whether the user is still active. Reference values: true | false. |
view_loading_type |
string | Page loading type. Reference value: initial_load. |
view_referrer |
string | Page referrer (source). |
view_url |
string | Page URL. |
view_host |
string | Hostname part of the page URL. |
view_path |
string | Path part of the page URL. |
view_path_group |
string | Path group of the page URL. |
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. See error type for reference. |
resource_status |
string | Resource request status code. |
resource_url |
string | Resource URL. |
resource_url_host |
string | Hostname part of the resource URL. |
resource_url_path |
string | Path part of the resource URL. |
resource_url_path_group |
string | Path group of the resource URL. |
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 | Determines whether the user is still active. Reference values: true | false. |
view_loading_type |
string | Page loading type. Reference value: initial_load. |
view_referrer |
string | Page referrer (source). |
view_url |
string | Page URL. |
view_host |
string | Hostname part of the page URL. |
view_path |
string | Path part of the page URL. |
view_path_group |
string | Path group of the page URL. |
view_url_query |
string | Query part of the page URL. |
Metrics¶
| Field | Type | Description |
|---|---|---|
duration |
number(ns) | Time spent by the long task generated during page loading. |
Action¶
View Attributes¶
| Field | Type | Description |
|---|---|---|
view_id |
string | Unique ID generated each time a page is visited. |
is_active |
boolean | Determines whether the user is still active. Reference values: true | false. |
view_loading_type |
string | Page loading type. Reference value: initial_load. |
view_referrer |
string | Page referrer (source). |
view_url |
string | Page URL. |
view_host |
string | Hostname part of the page URL. |
view_path |
string | Path part of the page URL. |
view_path_group |
string | Path group of the page URL. |
view_url_query |
string | Query part of the page URL. |
Action Attributes¶
| Field | Type | Description |
|---|---|---|
action_id |
string | Unique ID generated when the user performs an action on the page. |
action_name |
string | Action name. |
action_type |
string | Action type. |
Metrics¶
| Field | Type | Description |
|---|---|---|
duration |
number(ns) | Time spent on the page action. |
Statistics¶
| 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. |
