Skip to content

Flutter Application Data Collection


Introduction

Flutter data collection depends on the Android and iOS native frameworks. For comparison with Android and iOS data collection, the items marked with strikethrough below are features that have not been implemented.

Data Types

TrueWatch Real User Monitoring (RUM) includes six data types.

Type Description
session A record of user session information. Within the current session, user page, resource, action, error, and long task-related visit data is tracked at the session level.
view A view record is generated each time a user visits a page in the mobile application. While the user stays on the same page, resource, long task, error, and action records are linked to the relevant RUM view through the view_id attribute.
resource A record of resource information loaded when a user visits a page.
error An exception or crash emitted 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 the specified duration threshold.
action Records user activity in the mobile application (app launch, click, swipe, back, etc.). Each action is attached with a unique action_id.

Global Attributes

RUM use case creation and event alerts can both be queried through 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

Application Attributes

Field Type Description
app_id string Required. Unique ID for the RUM application, automatically generated when a monitor is created in the TrueWatch console.
env string Required. Environment field. Values: prod/gray/pre/common/local, where:
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 to which it belongs. Fixed names:
df_rum_ios
df_rum_android
df_rum_windows
df_rum_linux

User & Session Attributes

Field Type Description
userid string Unauthenticated users use a random UUID as 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 15 minutes of inactivity.
session_type string Session type. Reference values: user & synthetics
user: data generated by RUM features;
synthetics: data generated by headless synthetic tests.
is_signin boolean Whether the user is a registered user. 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, generated using Android: ANDROID_ID and iOS: UIDevice.identifierForVendor
os string Operating system information
os_version string Operating system version
os_version_major string Major operating system version
screen_size string Screen resolution

Geographic & Network Attributes

Field Type Description
ip string User IP address
isp string Carrier
network_type string Network connection type. Reference 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 (the SDK supports user-defined tag data) to build use cases and configure event alerts. Custom attributes are non-global attributes. Through custom attributes, you can track the entire process of users visiting the application, locate and identify affected user visits, and monitor user visit performance.

Other Data Type Attributes

Session

Attributes

Field Type Description
session_id string Session ID
session_type string Session type. Reference values: user & test
user: data generated by RUM features;
test: data generated by headless synthetic tests.
session_referrer string Session referrer. Usually the page address of the referrer.
session_first_view_id string view_id of the first page in the current session
session_first_view_name string URL of the first page in the current session
session_last_view_id string view_id of the last visited page in the current session
session_last_view_name string URL of the last page in the current session

Metrics

Field Type Description
time_spent number(ns) Duration of the current session
session_view_count number Number of view_ids 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

Action Attributes

Field Type Description
action_id string Unique ID generated when a user performs a page action
action_name string Action name
action_type string Action type (cold/warm start, click, and other actions)

Metrics

Field Type Description
loading_time number(ns) Page loading time. For Flutter pages, this can be set by calling createView(viewName, duration) before manually calling starView(); starting from SDK 0.5.8, it can also be updated by calling updateViewLoadingTime(duration) after the current view starts and before it ends. Flutter automatic routing does not automatically measure business loading time
network_settled_time number(ns) Supported starting from SDK 0.5.8. Initial network request time: the interval from the start of the view to the latest valid end of the selected initial resource, using the native default matching rules; not generated when there are no valid requests that meet the conditions
time_spent number(ns) Page dwell time
is_active boolean Whether the user is still active. Reference values: true & false

Metrics

Field Type Description
view_error_count number Number of errors that occur each time the page loads
view_resource_count number Number of resources requested each time the page loads
view_long_task_count number Number of long tasks generated each time the page loads
view_action_count number Number of actions during page viewing

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

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 a user performs a page action
action_name string Action name
action_type string Action type (cold/warm start, click, and other actions)

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 Resource URL path group
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) Resource loading DNS resolution time
Calculation: domainLookupEnd - domainLookupStart
resource_tcp number(ns) Resource loading TCP connection time
Calculation: connectEnd - connectStart
resource_ssl number(ns) Resource loading SSL connection time
Calculation: connectEnd - secureConnectStart
resource_ttfb number(ns) Resource loading request response time
Calculation: responseStart - requestStart
resource_trans number(ns) Resource loading content transfer time
Calculation: responseEnd - responseStart
resource_first_byte number(ns) Resource loading first byte time
Calculation: responseStart - domainLookupStart
duration number(ns) Resource loading time. The overall duration is recorded via startResource() / stopResource()
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 referrer, the parent of the page
view_name string Page name

Action Attributes

Field Type Description
action_id string Unique ID generated when a user performs a page action
action_name string Action name
action_type string Action type (cold/warm start, 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: flutter_crash | java_crash | native_crash | anr_error | anr_crash | ios_crash
network error type: network_error
error_situation string Timing 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_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 Resource URL path group
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
locale string Current system language

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
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 a user performs a page action
action_name string Action name
action_type string Action type (cold/warm start, 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

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 a user performs a page action
action_name string Action name
action_type string Action type (cold/warm start, click, and other actions)

Metrics

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

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