Skip to content

Android Application Data Collection


After collecting application data to TrueWatch, you can customize scenarios and configure anomaly detection events through the TrueWatch console.

Data Types

TrueWatch's RUM includes six data types. Among them, the Android SDK natively reports five types of data: view, resource, error, long_task, and action. session is aggregated data based on session dimensions.

Type Description
session User session information record. Within the current session, it will be based on session dimension user page, resource, action, error, and long task related access data.
view A view record is generated each time a user accesses a page of a mobile application. When a user stays on the same page, resource, long task, error, and action records are linked to the relevant RUM view via the view_id attribute.
resource Record of resource information loaded when a user accesses a page.
error Exceptions or crashes issued by the mobile application.
long_task A long task event is generated for any task in the application that blocks the main thread for longer than a specified duration threshold.
action Records user activities in the mobile application (application startup, click, swipe, back, etc.). Each action is attached with a unique action_id.

Global Attributes

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

SDK Attributes

Field Type Description
sdk_name string Collector name, fixed names:
df_macos_rum_sdk
df_linux_rum_sdk
df_windows_rum_sdk
df_web_rum_sdk
df_miniapp_rum_sdk
df_ios_rum_sdk
df_android_rum_sdk
sdk_version string Collector version information
sdk_pkg_info string Collector version information collection, including SDK internal module 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 TrueWatch 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 Optional, name of the business or service it belongs to. Fixed names:
df_rum_ios
df_rum_android
df_rum_windows
df_rum_linux
application_uuid string Application unique identifier.

User & Session Attributes

Field Type Description
userid string Unlogged users use a random UUID as userid, logged 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, if no operation for more than 15 minutes, a new session_id will be generated.
session_type string Session type. Reference values: user & synthetics
user: data generated by RUM functionality;
synthetics: data generated by headless testing.
is_signin boolean Whether it is a registered user, attribute values: T & F.
session_has_replay boolean Whether the current session is associated with Session Replay data.

Device & Resolution Attributes

Field Type Description
device string Mobile device manufacturer
model string Mobile device model
device_uuid string Mobile device unique ID. Generated using ANDROID_ID
os string Operating system information
os_version string Operating system version
os_version_major string Operating system major version
screen_size string Screen resolution
arch string Processor architecture

Geographic & Network Attributes

Field Type Description
ip string User access IP address
isp string Carrier
network_type string Network connection type, attribute value reference:
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, scenarios can also be constructed and event alerts configured using custom attributes (SDK supports users tagging custom tag data). Custom attributes are non-global attributes. Through custom attributes, you can track the entire process of user access to the application, locate and discover affected user access situations, and monitor user access performance.

Other Data Type Attributes

Session

Session related data is server-side session dimension aggregated data, not a measurement natively reported directly by the Android SDK.

Attributes

Field Type Description
session_id string Session ID
session_type string Session type. Reference values: user & synthetics
user: data generated by RUM functionality;
synthetics: data generated by headless testing.
session_referrer string Session source. Usually records the source page address.
session_first_view_id string The view_id of the first page of the current session
session_first_view_name string The URL of the first page of the current session
session_last_view_id string The view_id of the last accessed page of the current session
session_last_view_name string The URL of the last page of the current session

Statistical Metrics

Field Type Description
time_spent number(ns) Duration of the current session
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 operations 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_referrer string Page source, parent of the page
view_name string Page name

Metrics

Field Type Description
loading_time number(ns) Page loading time
time_spent number(ns) Page dwell time
is_active boolean Determine whether the user is still active, reference values: true & false
session_sample_rate number RUM session sampling rate
session_on_error_sample_rate number Error session sampling rate
sampled_for_error_session boolean Whether the current session is an error sampling session, reference values: true & false
sampled_for_error_replay boolean Whether the current session is an error Session Replay sampling, reference values: true & false
session_error_timestamp number(ns) Error occurrence time when the session triggers error sampling

Statistical Metrics

Field Type Description
view_error_count number Number of errors that occurred each time the page loaded
view_resource_count number Number of resources requested each time the page loaded
view_long_task_count number Number of long tasks generated each time the page loaded
view_long_task_rate number Proportion of long task duration within the page lifecycle
view_action_count number Number of operations during page view

Monitoring Metrics

Field Type Description
cpu_tick_count number Optional, number of CPU ticks for this page
cpu_tick_count_per_second number Optional, average number of CPU ticks per second
fps_avg number Optional, average frames per second for the page
fps_mini number Optional, minimum frames per second for the page
memory_avg number Optional, average memory usage for the page
memory_max number Optional, peak memory usage for the page
battery_current_avg number Optional, average battery current for the page
battery_current_max number Optional, maximum battery current for the page

Resource

View Attributes

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

Action Attributes

Field Type Description
action_id string Unique ID generated during user page operation
action_name string Action name

Resource Attributes

Field Type Description
resource_url string Resource URL
resource_id string Resource unique ID
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 grouping
resource_type string Category of the resource
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
response_connection string Value of the resource response header Connection
response_content_type string Value of the resource response header Content-Type
response_content_encoding string Value of the resource response header Content-Encoding
resource_http_protocol string HTTP protocol used for the resource request
resource_connection_reuse boolean Whether the resource request reuses the connection
span_id string APM trace Span ID
trace_id string APM trace Trace ID
session_has_replay boolean Whether the current resource is associated with Session Replay data

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 transmission 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)
resource_request_size number Resource request size, default unit: byte
resource_dns_time object Resource DNS resolution time, format: {duration: number(ns), start: number(ns)}
resource_connect_time object Resource connection duration, format same as resource_dns_time
resource_first_byte_time object First byte time for resource loading, format same as resource_dns_time
resource_ssl_time object Resource SSL connection duration, format same as resource_dns_time
resource_download_time object Resource download duration, format same as resource_dns_time
request_header string Resource request header
response_header string Resource response header

Network Snapshot Metrics

Field Type Description
network_available boolean Whether the network was available when the resource request started
network_validated boolean Whether the network had been validated by the system when the resource request started
network_downlink_kbps number Network downlink bandwidth when the resource request started, unit: kbps
network_uplink_kbps number Network uplink bandwidth when the resource request started, unit: kbps
network_signal_strength number Network signal strength when the resource request started

Error

View Attributes

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

Action Attributes

Field Type Description
action_id string Unique ID generated during user page operation
action_name string Action name

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 Timing of the error occurrence, reference values: startup (at startup) and run (at runtime)

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

Field Type Description
resource_status string Status value returned by the resource request
resource_status_group string Status group value returned by the resource request
resource_id string Resource unique ID
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 grouping
resource_method string Resource request method

Error Monitoring Attributes

Field Type Description
memory_total string Optional, total memory
memory_use number Optional, memory usage rate
cpu_use number Optional, CPU usage rate
battery_use number Optional, current battery level of the phone
carrier string Optional, mobile cellular carrier
locale string Current system language

Metrics

Field Type Description
error_message string Error message
error_stack string Error stack
foreground_crash_free_duration number(ns) Foreground crash-free duration
background_crash_free_duration number(ns) Background crash-free duration

Long Task

View Attributes

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

Action Attributes

Field Type Description
action_id string Unique ID generated during user page operation
action_name string Action name

Metrics

Field Type Description
duration number(ns) Lag duration
long_task_stack string Lag stack
session_has_replay boolean Whether the current long task is associated with Session Replay data

Action

View Attributes

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

Action Attributes

Field Type Description
action_id string Unique ID generated during user page operation
action_name string Action name
action_type string Action type (cold/hot startup, click, etc.)
app_launch_type string Launch type for cold startup Action, reference values: foreground (foreground launch) and background (background launch). Supported by ft-sdk version 1.7.2 and above

Metrics

Field Type Description
duration number(ns) Time spent on page operation
app_pre_application_init_time object During cold startup, initialization duration from process start to before Application.onCreate(), format: {duration: number(ns), start: number(ns)}
app_application_init_time object During cold startup, initialization duration from Application.onCreate() to the first Activity preOnCreate(), format same as app_pre_application_init_time
app_first_frame_init_time object During cold startup, duration from the first Activity preOnCreate() to the first frame drawing completion, format same as app_pre_application_init_time
session_has_replay boolean Whether the current operation is associated with Session Replay data

Statistical Metrics

Field Type Description
action_long_task_count number Number of long tasks associated with the operation
action_resource_count number Number of resource requests associated with the operation
action_error_count number Number of errors associated with the operation