Skip to content

Web Application Data Collection


After application data is collected to Guance, you can customize scenarios and configure anomaly detection events through the Guance console.

Data Types

Guance's RUM includes six data types:

Type Description
session Records user session information. During the current session, user page, resource, action, error, and long task related access data are captured based on the session dimension.
view A page view record is generated each time a user accesses a page. When a 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 Records resource information loaded when a user accesses a page.
error The RUM collector gathers all front-end errors on the browser.
long_task A long task record is generated for any task in the browser that blocks the main thread for more than 50ms.
action Tracks all user interaction records during the user's page browsing process.

Global Attributes

Both scenario construction and event alerts in RUM can be queried using the following global attributes.

SDK Attributes

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

Application Attributes

Field Type Description
app_id string Required, unique ID identifier for the RUM application, automatically generated when creating a monitor in the Guance console.
env string Required, environment field. Attribute values: prod/gray/pre/common/local. Among them:
prod: production environment;
gray: gray environment;
pre: pre-release environment;
common: daily environment;
local: local environment.
version string Required, version number.
service string Required, the service field value configured in the RUM SDK.

User & Session Attributes

Field Type Description
userid string By default, the browser cookie is obtained as userid. If a custom user identifier is used to set the user id, then userid will be consistent with the defined one.
❗️ Cookie expiration time is 60 days.
session_id string Session id (a user session is considered expired if no interaction occurs within 15 minutes).
session_type string Session type. Reference values: user & synthetics:
  • user: Data generated by RUM;
  • synthetics: Data generated by headless testing.
  • is_signin boolean Whether it 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 provider
    browser_version string Browser version
    browser_version_major string Major browser version information
    screen_size string Screen width*height, resolution

    Geographic & Network Attributes

    Field Type Description
    ip string User access IP address
    isp string Internet service provider
    network_type string Network connection type, 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 (SDK supports user-defined tag data) to build scenarios and configure event alerts. Custom attributes are non-global attributes. Through custom attributes, you can track the entire process of user access to the application, locate and discover user-affected access situations, and monitor user access performance.

    Other Data Type Attributes

    Session

    Attributes

    Field Type Description
    session_id string Session id (a user session is considered expired if no interaction occurs within 15 minutes)
    session_type string Session type. Reference values: user & synthetics:
  • user: Data generated by RUM;
  • synthetics: Data generated by headless testing.
  • session_first_view_id string The view_id of the first page of the current session
    session_first_view_url string The URL of the first page of the current session
    session_first_view_host string The domain name of the first page of the current session
    session_first_view_path string The address of the first page of the current session
    session_first_view_path_group string The address group of the first page of the current session
    session_first_view_url_query string The query information of the first page of the current session
    session_first_view_name string The address group of the first page of the current session, same as the session_first_view_path_group field
    session_last_view_id string The view_id of the last accessed page of the current session
    session_last_view_url string The URL of the last page of the current session
    session_last_view_host string The domain name of the last page of the current session
    session_last_view_path string The address of the last page of the current session
    session_last_view_path_group string The address group of the last page of the current session
    session_last_view_url_query object The query information of the last page of the current session
    session_last_view_name string The address group of the last page of 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 by 4-hour intervals, increments by 1 for each additional 4 hours
    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 accessed
    view_loading_type string Page loading type, reference values: initial_load route_change route_change is the SPA page loading mode
    view_referrer string Page source
    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 Path group of the page URL
    view_url_query string Query part of the page URL

    Metrics

    Metric Type (Unit) Introduction
    loading_time number(ns) The page is ready and there are no network requests or DOM changes. For details, refer to Page Loading Time
    largest_contentful_paint number(ns) LCP reports the rendering time of the largest image or text block visible in the viewport (relative to the time the user first navigates to the corresponding page). To provide a good user experience, LCP should occur within 2.5 seconds of the page first starting to load.
    largest_contentful_paint_element_selector string The selector of the element corresponding to the LCP metric
    cumulative_layout_shift number(ns) Cumulative Layout Shift, measuring visual stability. To provide a good user experience, the page's CLS should be kept at 0.1. or less.
    cumulative_layout_shift_target_selector number(ns) The 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, currently replaced by inp
    interaction_to_next_paint number(ns) Improves FID by considering all page interactions (from input delay to the time required to run event handlers, to the browser painting the next frame).
    interaction_to_next_paint_target_selector number(ns) The selector of the element corresponding to 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 the page 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 triggered when the pure HTML is fully loaded and parsed, without waiting for stylesheets, images, or subframes to finish loading. Refer to MDN
    dom_complete number(ns) The page and all sub-resources are ready. For the user, the loading animation has stopped spinning. Refer to MDN
    load_event number(ns) Triggered when the entire page and all dependent resources such as stylesheets and images have finished loading. It is different from DOMContentLoaded, which is triggered as soon as the page DOM is loaded, without waiting for dependent resources to load. Refer to MDN
    resource_load_time number(ns) Resource loading time
    Calculation method: loadEventStart - domContentLoadedEventEnd
    time_to_interactive number(ns) Time to Interactive
    Calculation method: domInteractive - fetchStart
    dom number(ns) DOM parsing time
    Calculation method: domComplete - domInteractive
    dom_ready number(ns) DOM Ready time
    Calculation method: domContentLoadedEventEnd - navigationStart
    time_spent number(ns) Page dwell time
    is_active boolean Determines whether the user is still active, reference values: true & false

    Statistical Metrics

    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 the page view process
    view_apdex_level number Page Apdex satisfaction level.
    Basic 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 indicates >= 9 seconds)

    Resource

    View Attributes

    Field Type Description
    view_id string Unique ID generated each time a page is accessed
    is_active boolean Determines whether the user is still active, reference values: true | false
    view_loading_type string Page loading type, reference values: initial_load
    view_referrer string Page source
    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 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 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 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: byte
    resource_dns number(ns) DNS resolution time for resource loading
    Calculation method: domainLookupEnd - domainLookupStart
    resource_tcp number(ns) TCP connection time for resource loading
    Calculation method: connectEnd - connectStart
    resource_ssl number(ns) SSL connection time for resource loading
    Calculation method: connectEnd - secureConnectStart
    resource_ttfb number(ns) Request response time for resource loading
    Calculation method: responseStart - requestStart
    resource_trans number(ns) Content transfer time for resource loading
    Calculation method: responseEnd - responseStart
    resource_first_byte number(ns) First byte time for resource loading
    Calculation method: responseStart - domainLookupStart
    duration number(ns) Resource loading time
    Calculation method: duration(responseEnd-startTime)

    Error

    View Attributes

    Field Type Description
    view_id string Unique ID generated each time a page is accessed
    is_active boolean Determines whether the user is still active, reference values: true | false
    view_loading_type string Page loading type, reference values: initial_load
    view_referrer string Page source
    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 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, 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 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 accessed
    is_active boolean Determines whether the user is still active, reference values: true | false
    view_loading_type string Page loading type, reference values: initial_load
    view_referrer string Page source
    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 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 on long tasks generated during page loading

    Action

    View Attributes

    Field Type Description
    view_id string Unique ID generated each time a page is accessed
    is_active boolean Determines whether the user is still active, reference values: true | false
    view_loading_type string Page loading type, reference values: initial_load
    view_referrer string Page source
    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 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 during user page operations
    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

    Feedback

    Is this page helpful? ×