Skip to content

Android Application Data Collection


Once application data is collected into TrueWatch, you can customize scenarios and configure anomaly detection events through the TrueWatch console.

Data Types

Real User Monitoring (RUM) in TrueWatch includes six data types. The Android SDK natively reports five types of data directly: view, resource, error, long_task, and action. session is aggregated data based on the session dimension.

Type Description
session Records user session information. In the current session, access data for user pages, resources, actions, errors, and long tasks is aggregated based on the session dimension.
view A view record is generated each time the user visits a page in the mobile app. While the 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 the user visits a page.
error Exceptions or crashes triggered in the mobile app.
long_task A long task event is generated for any task that blocks the main thread longer than the specified duration threshold.
action Records user activities in the mobile app (app launch, click, swipe, back, etc.). Each action has a unique action_id attached.

Global Attributes

RUM scenario building and event alerting can both be queried using the global attributes below.

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 Collection of collector version information, including the version information of SDK internal modules.

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 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 Anonymous users use a random UUID as userid; logged-in users use the user ID generated by the application backend.
visitor_id string Optional. Anonymous visitor identifier automatically generated by the SDK. Disabled by default; after a valid configuration is passed via FTRUMConfig.setVisitorIdConfig(...), native RUM data will be associated with this field. Persisted per process, with a default validity of 24 hours. It can be actively reset via FTSdk.resetVisitorId(). See Visitor ID for details.
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 features;
synthetics: data generated by headless tests.
is_signin boolean Whether the user 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's access IP address
isp string ISP
network_type string Network connection type. Reference 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 build scenarios and configure event alerts with custom attributes (the SDK supports users attaching custom tag data). Custom attributes are non-global attributes. With custom attributes, you can track the entire process of user visits to the app, pinpoint and identify affected user visits, and monitor user visit performance.

Attributes of Other Data Types

Session

Session-related data is server-side aggregated data based on the session dimension, not a measurement directly reported 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 features;
synthetics: data generated by headless tests.
session_referrer string Session source. Usually the page address of the source.
session_first_view_id string view_id of the first page of the current session
session_first_view_name string URL of the first page of the current session
session_last_view_id string view_id of the last page visited in the current session
session_last_view_name string 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 values 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_referrer string Page referrer, 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
network_settled_time number(ns) Interval from the start of the View to the latest end of the selected initial Resources.
By default, all requests under this View that satisfy Resource start time - View start time < 100 ms are selected; exactly 100 ms is not counted. The "initial Resources" are a group of requests, not the first request.
interaction_to_next_view_time number(ns) The start time of the new View minus the time of the last valid interaction of the previous View; the result is written to the new View.
By default, the time difference must be strictly greater than 0 and less than 3000 ms; if it equals 0 or 3000 ms, this field is not generated. Abbreviated as INV.
is_active boolean 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-sampled session. Reference values: true & false
sampled_for_error_replay boolean Whether the current session is sampled for error Session Replay. Reference values: true & false
session_error_timestamp number(ns) Time of error occurrence when the session triggers error sampling

network_settled_time and interaction_to_next_view_time apply only to native Views and do not change the metric calculation of the Browser SDK in WebView.

network_settled_time does not indicate that the first screen has finished painting or that the page is interactive: data processing and painting may still be required after requests finish, and requests started outside the default window do not participate in the calculation. For example, if two initial requests finish at 150 ms and 400 ms after the View starts, the field is 400000000 when the write conditions are satisfied, not the sum of the two request durations.

To adjust the time window, customize the conditions, or disable these metrics, see Custom Rules for View Duration Metrics.

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_long_task_rate number Proportion of long task duration in the page lifecycle
view_action_count number Number of actions during page viewing

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 of the page
fps_mini number Optional. Minimum frames per second of 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 referrer, 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

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 Path group of the resource URL
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 Connection header in the resource response
response_content_type string Value of the Content-Type header in the resource response
response_content_encoding string Value of the Content-Encoding header in the resource response
resource_http_protocol string HTTP protocol used by the resource request
resource_connection_reuse boolean Whether the resource request reuses a connection
span_id string Application Performance Monitoring (APM) link Span ID
trace_id string APM link 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: 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)
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 time. Same format as resource_dns_time
resource_first_byte_time object Time to first byte for resource loading. Same format as resource_dns_time
resource_ssl_time object Resource SSL connection time. Same format as resource_dns_time
resource_download_time object Resource download time. Same format as resource_dns_time
request_header string Resource request headers
response_header string Resource response headers

Network Snapshot Metrics

Field Type Description
network_available boolean Whether the network is available at the start of the resource request
network_validated boolean Whether the network has passed system validation at the start of the resource request
network_downlink_kbps number Network downlink bandwidth at the start of the resource request. Unit: kbps
network_uplink_kbps number Network uplink bandwidth at the start of the resource request. Unit: kbps
network_signal_strength number Network signal strength at the start of the resource request

Error

View Attributes

Field Type Description
view_id string Unique ID generated each time a page is visited
view_referrer string Page referrer, 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

Error Attributes

Field Type Description
error_source string Error source. Reference values: logger | network
error_type string Error type
Logger error types: java_crash | native_crash | anr_error | anr_crash
Network error type: network_error
error_situation string Timing of the error. 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 Path group of the resource URL
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
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) Duration without crashes in the foreground
background_crash_free_duration number(ns) Duration without crashes in the background

Long Task

View Attributes

Field Type Description
view_id string Unique ID generated each time a page is visited
view_referrer string Page referrer, 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

Metrics

Field Type Description
duration number(ns) Jank duration
long_task_stack string Jank 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 visited
view_referrer string Page referrer, 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 start, click, and other actions)
app_launch_type string Launch type of a cold start Action. Reference values: foreground (foreground launch) and background (background launch). Supported in ft-sdk 1.7.2 and above

Metrics

Field Type Description
duration number(ns) Time spent on the page action
app_pre_application_init_time object For cold start, the initialization time from process start to before Application.onCreate(). Format: {duration: number(ns), start: number(ns)}
app_application_init_time object For cold start, the initialization time from Application.onCreate() to the first Activity's preOnCreate(). Same format as app_pre_application_init_time
app_first_frame_init_time object For cold start, the time from the first Activity's preOnCreate() to the completion of the first frame rendering. Same format as app_pre_application_init_time
session_has_replay boolean Whether the current action is associated with Session Replay data

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