Skip to content

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 user page, resource, action, error, and long task access data based on the session dimension.
view Every time a user visits a page, a page view record is generated. When the user stays on the same page, resource, long task, error, and action records are linked to the related RUM view via the view_id attribute.
resource Records the resource loading information when the 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 50ms, a long task record is generated.
action Tracks all user interaction records during page browsing.

Global Attributes

The scenario building and event alerting of RUM can be queried through the following global attributes.

SDK Attributes

Field Type Description
sdk_name string Collector name, fixed values:
df_web_rum_sdk
df_miniapp_rum_sdk
df_ios_rum_sdk
df_android_rum_sdk
sdk_version string Collector version.

Application Attributes

Field Type Description
app_id string Required. The unique ID of the RUM application, automatically generated when creating 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 Defaults to the browser Cookie as userid. If a user ID is set using custom user identification, then userid will match the defined value.
❗️ Cookie expiration time is 60 days.
session_id string Session ID (a session is considered expired if no user interaction occurs within 15 minutes).
session_type string Session type. Reference values: user & synthetics:
  • user: data generated by RUM;
  • synthetics: data generated by headless synthetic tests.
  • 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

    Geography & Network Attributes

    Field Type Description
    ip string User IP address
    isp string Internet service provider
    network_type string Network connection type. Reference values:
    wifi | 2g | 3g | 4g | 5g | unknown | 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 custom tag data from users) to build scenarios and configure event alerts. Custom attributes are non-global attributes. Through custom attributes, you can track the entire user access process, locate and identify affected user visits, and monitor user access performance.

    Other Data Type Attributes

    Session

    Attributes

    Field Type Description
    session_id string Session ID (a session is considered expired if no user interaction occurs within 15 minutes)
    session_type string Session type. Reference values: user & synthetics:
  • user: data generated by RUM;
  • synthetics: data generated by headless synthetic tests.
  • 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 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 string 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 session_first_view_path_group
    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 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 string 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 session_last_view_path_group

    Metrics

    Field Type Description
    time_spent number(ns) Duration of the current session
    session_time_spent_count number Calculated in 4-hour intervals; each 4-hour increment adds 1
    session_view_count number Number of view_id 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 for SPA page loading mode
    view_referrer string Page referrer
    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 string part of the page URL
    session_has_replay boolean Whether the session to which the current View belongs has generated associable session replay data

    Metrics

    Metric Type (Unit) Description
    loading_time number(ns) The page is ready and there are no network requests or DOM changes. Refer to 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 (relative to when the user first navigated to the page). For a good user experience, LCP should occur within 2.5 seconds of the page first starting to load.
    largest_contentful_paint_element_selector string Selector of the element corresponding to the LCP metric
    cumulative_layout_shift number Cumulative Layout Shift measures visual stability. For a good user experience, pages should maintain a CLS of 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 for the first user interaction on the page; Core Web Vitals now use 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 triggered the first interaction
    interaction_to_next_paint number(ns) Measures the overall responsiveness to user interactions throughout the page visit, including input delay, event processing, and next frame paint time
    interaction_to_next_paint_target_selector string Selector of the interaction element that generated the INP metric
    first_contentful_paint number(ns) First Contentful Paint (FCP) measures the time from when the page starts loading to when any part of the page's content is rendered on the screen. For this metric, "content" refers to text, images (including background images), <svg> elements, or non-white <canvas> elements. Refer to w3c
    first_byte number(ns) Time from request to the first byte of the page response
    dom_interactive number(ns) Time when the parser finishes parsing the document. Refer to MDN
    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. Refer to MDN
    dom_complete number(ns) The page and all subresources are ready. For the user, the loading spinner has stopped spinning. Refer to 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 is loaded, without waiting for dependent resources. Refer to MDN
    first_paint_time number(ns) Duration of the document response phase calculated by the current SDK
    Calculation: responseEnd - fetchStart
    resource_load_time number(ns) Resource loading time
    Calculation: loadEventStart - domContentLoadedEventEnd
    time_to_interactive number(ns) Time to 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) Page dwell time
    is_active boolean Whether the user is still active. Reference values: true & false

    Metrics (Counters)

    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 during page viewing
    frustration_count number Number of frustrating behaviors associated with the current View
    view_apdex_level number Page Apdex satisfaction level.
    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; connection, message, and close fields are described in WebSocket Long 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 loading type. Reference value: initial_load
    view_referrer string Page referrer
    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 string 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 string part of the resource URL
    resource_url_path_group string Path group of the resource URL
    resource_type string Resource category
    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

    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) Time to first byte for resource loading
    Calculation: responseStart - domainLookupStart
    duration number(ns) Resource loading 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 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
    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 string 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 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 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
    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 string part of the page URL

    Metrics

    Field Type Description
    duration number(ns) Time spent on long tasks 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 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
    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 string part of the page URL

    Action Attributes

    Field Type Description
    action_id string Unique ID generated on user page action
    action_name string Action name
    action_type string Action type

    Metrics

    Field Type Description
    duration number(ns) Time spent on page action

    Metrics (Counters)

    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