Skip to content

HarmonyOS Application Data Collection


After application data is collected into Guance, you can use the Guance console to configure custom scenarios and anomaly detection events.

Data Types

Guance Real User Monitoring (RUM) includes six data types:

Type Description
session Records user session information. During the current session, access data for user pages, resources, actions, errors, and long tasks is recorded at the session level.
view A view record is generated each time a user visits a page in the mobile application. When the user stays on the same page, resource, Long Task, error, and action records are linked to the corresponding RUM view via the view_id attribute.
resource Records resource information loaded when a user visits a page.
error Exceptions or crashes raised by the mobile application.
long_task A Long Task event is generated for any task that blocks the main thread for longer than the specified duration threshold.
action Records user activities in the mobile application (app launch, click, swipe, back, etc.). Each action has a unique action_id attached.

Global Attributes

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

SDK Attributes

Field Type Description
sdk_name string Collector name. Fixed name: df_harmonyos_rum_sdk
sdk_version string Collector version information
sdk_pkg_info string SDK package information (JSON format)

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. Possible 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 Optional. Name of the business or service it belongs to. Fixed name: df_rum_harmonyos
application_uuid string Unique application identifier. Applications with the same Build share the same UUID.

User & Session Attributes

Field Type Description
userid string Unauthenticated users use a random UUID as the userid; authenticated users use the user ID generated by the application backend.
user_name string Optional. User name.
user_email string Optional. User email.
session_id string Session ID. A new session_id is generated after more than 15 minutes of inactivity.
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. Possible values: T & F.

Device & Resolution Attributes

Field Type Description
device string Mobile device manufacturer
model string Mobile device model
device_uuid string Unique mobile device ID
os string Operating system information, fixed as HarmonyOS
os_version string Operating system version
os_version_major string Major operating system version
screen_size string Screen resolution
arch string System architecture (e.g., aarch64)

Geographic & Network Attributes

Field Type Description
network_type string Network connection type. Possible values:
wifi & 2g & 3g & 4g & 5g & unknown (unknown network) & unreachable (network unavailable)

Custom Attributes

In addition to global attributes, you can also build scenarios and configure event alerts using custom attributes (the SDK supports users adding custom tag data). Custom attributes are non-global attributes. With custom attributes, you can track the entire user access journey, identify and locate affected user visits, and monitor user access performance.

Attributes of Other Data Types

Session

Attributes

Field Type Description
session_id string Session ID
session_type string Session type. Reference values: user & test
user: data generated by RUM;
test: data generated by headless synthetic tests.

View

Attributes

Field Type Description
view_id string Unique ID generated each time a page is visited
view_referrer string Page source, the parent of the page
view_name string Page name

Metrics

Field Type Description
loading_time number (ns) Page loading time
time_spent number (ns) Time spent on the page
is_active boolean Indicates whether the user is still active. Reference values: true & false

Count Metrics

Field Type Description
view_error_count number Number of errors that occur with each page load
view_resource_count number Number of resources requested with each page load
view_long_task_count number Number of Long Tasks generated with each page load
view_action_count number Number of actions during the page view

Monitoring Metrics

Field Type Description
cpu_tick_count number Optional. CPU tick count for this page
cpu_tick_count_per_second number Optional. Average CPU ticks per second
fps_avg number Optional. Average frames per second on the page
fps_mini number Optional. Minimum frames per second on the page
memory_avg number Optional. Average memory usage of the page
memory_max number Optional. Peak memory usage of the page
battery_current_avg number Optional. Average battery current of the page
battery_current_max number Optional. Maximum battery current of the page

Resource

View Attributes

Field Type Description
view_id string Unique ID generated each time a page is visited
view_referrer string Page source, the parent of the page
view_name string Page name

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 (cold/hot launch, click, and other actions)

Resource Attributes

Field Type Description
resource_id string Stable unique ID of the Resource
resource_url string Resource URL
resource_url_host string Host portion of the resource URL
resource_url_path string Path portion 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
resource_host_ip string Target IP accessed by the resource URL
trace_id string Distributed tracing ID (optional when distributed tracing is enabled)
span_id string Distributed tracing span ID (optional when distributed tracing is enabled)
response_connection string Response connection type (optional)
response_content_type string Response content type (optional)
response_content_encoding string Response content encoding (optional)

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) Time to first byte for resource loading
Calculation: responseStart - domainLookupStart
duration number (ns) Resource loading time
Calculation: duration(responseEnd-startTime)
request_header string Resource request header
response_header string Resource response header

Error

View Attributes

Field Type Description
view_id string Unique ID generated each time a page is visited
view_referrer string Page source, the parent of the page
view_name string Page name

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 (cold/hot launch, click, and other actions)

Error Attributes

Field Type Description
error_source string Error source. Reference values: logger | network
error_type string Error type
logger error type: java_crash | native_crash | anr_error | anr_crash
network error type: network_error
error_situation string When the error occurs. Reference values: startup (at startup) and run (at runtime)

When type=network, the following Network Error attributes are added.

Field Type Description
resource_id string Stable unique ID of the corresponding Resource
resource_status string Status value returned by the resource request
resource_url string Resource URL
resource_url_host string Host portion of the resource URL
resource_url_path string Path portion of the resource URL
resource_url_path_group string Path group of the resource URL
resource_method string Resource request method

Error Monitoring Attributes

Field Type Description
memory_total string Optional. Total device memory
memory_use number Optional. Current app memory usage
cpu_use number Optional. Current app CPU usage
battery_use number Optional. Device battery percentage
locale string Current system language

Metrics

Field Type Description
error_message string Error message
error_stack string Error stack trace

Long Task

View Attributes

Field Type Description
view_id string Unique ID generated each time a page is visited
view_referrer string Page source, the parent of the page
view_name string Page name

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 (cold/hot launch, click, and other actions)

Metrics

Field Type Description
duration number (ns) Long Task duration
long_task_message string Long Task message
long_task_stack string Long Task stack trace

Action

View Attributes

Field Type Description
view_id string Unique ID generated each time a page is visited
view_referrer string Page source, the parent of the page
view_name string Page name

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 (for example, click, launch_cold)
app_launch_type string Launch type of the cold-launch Action. Reference values: foreground (launched in the foreground), background (first UI display after returning from the background). Supported in ft-sdk 0.1.17 and later

Metrics

Field Type Description
duration number (ns) Time spent on the page action
app_pre_application_init_time object During cold launch, the phase from process startup to application initialization. Format: {start: number(ns), duration: number(ns)}
app_application_init_time object During cold launch, the phase from application initialization to the creation of the first UIAbility. Format: same as above
app_first_frame_init_time object During cold launch, the phase from the creation of the first UIAbility to the first rendered frame. Format: same as above

Count 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?