iOS/tvOS/macOS Application Data Collection
After application data is collected to TrueWatch, you can use the TrueWatch console to customize scenarios and configure anomaly detection events.
Data Types
TrueWatch's RUM includes six data types:
The RUM data types directly reported by the iOS SDK are view, resource, error, long_task, and action. session is session-level data, aggregated from the RUM data reported by the SDK.
| Type |
Description |
| session |
Records user session information. In the current session, user access data related to views, resources, actions, errors, and long tasks will be aggregated based on the session dimension. |
| view |
Each time a user visits a view in the mobile application, a view record is generated. While the user stays on the same view, resource, long task, error, and action records are linked to the relevant RUM view via the view_id attribute. |
| resource |
Records resource information loaded when a user accesses a view. |
| error |
Exceptions or crashes emitted by the mobile application. |
| long_task |
Generates a long task event for any task that blocks the main thread for longer than a specified duration threshold in the application. |
| action |
Records user activities in the mobile application (app launch, click, swipe, back, etc.). Each action is attached with a unique action_id. |
Global Attributes
Scenarios 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_ios_rum_sdk
df_tvos_rum_sdk
df_android_rum_sdk |
sdk_version |
string |
Collector version information |
sdk_pkg_info |
object |
SDK package information |
Application Attributes
| Field |
Type |
Description |
app_id |
string |
Required, unique ID of the RUM application, automatically generated when creating a monitor in the TrueWatch console. |
application_uuid |
string |
Application UUID, obtained by the iOS SDK from the main Mach-O UUID. |
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. Fixed names:
df_rum_ios
df_rum_tvos
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 if there is no operation for more than 15 minutes. |
session_type |
string |
Session type. Reference values: user & synthetics user: Data generated by the RUM feature; synthetics: Data generated by headless synthetic 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. After enabling Session Replay capabilities, View, Resource, Error, Long Task, and Action can write this field. |
custom_keys |
string |
List of RUM custom attribute keys. |
Device & Resolution Attributes
| Field |
Type |
Description |
device |
string |
Mobile device manufacturer |
model |
string |
Mobile device model |
device_uuid |
string |
Unique ID of the mobile device, generated using 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 |
arch |
string |
CPU architecture, e.g., arm64, arm64e, x86_64 |
Geographic & Network Attributes
| Field |
Type |
Description |
ip |
string |
User access IP address |
isp |
string |
Internet service provider |
network_type |
string |
Network connection type. Reference values: wifi & 2g & 3g & 4g & 5g & unknown (unknown network) & unreachable (network unreachable) |
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 users adding custom 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 access affected by issues, and monitor user access performance.
Other Data Type Attributes
Session
Session is session-level data, usually generated or aggregated by the server based on the RUM data reported by the SDK. It is not a measurement directly reported by the iOS SDK.
Attributes
| Field |
Type |
Description |
session_id |
string |
Session ID |
session_type |
string |
Session type. Reference values: user & synthetics user: Data generated by the RUM feature; synthetics: Data generated by headless synthetic tests. |
session_referrer |
string |
Session referrer. Usually records the source view address. |
session_first_view_id |
string |
view_id of the first view in the current session |
session_first_view_name |
string |
URL of the first view in the current session |
session_last_view_id |
string |
view_id of the last accessed view in the current session |
session_last_view_name |
string |
URL of the last view in the current session |
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 view is accessed |
view_referrer |
string |
View source, the parent of the view |
view_name |
string |
View name |
session_has_replay |
boolean |
Whether the session to which the current View belongs is associated with Session Replay data |
Metrics
| Field |
Type |
Description |
loading_time |
number(ns) |
View loading time |
time_spent |
number(ns) |
Time spent on the view |
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 |
Sampling rate for error fallback when the RUM Session sampling is not hit |
session_replay_sample_rate |
number |
Session Replay sampling rate, appears after enabling Session Replay capabilities |
session_replay_on_error_sample_rate |
number |
Sampling rate for Session Replay error fallback, appears after enabling Session Replay capabilities |
sampled_for_error_session |
boolean |
Whether the current Session was sampled due to the error sampling strategy |
sampled_for_error_replay |
boolean |
Whether the current Session Replay was sampled due to the error sampling strategy |
session_error_timestamp |
number(ns) |
Timestamp of the error when error sampling is hit |
session_replay_stats |
object |
Session Replay statistics associated with the current View |
Aggregated Metrics
| Field |
Type |
Description |
view_error_count |
number |
Number of errors that occurred during each view load |
view_resource_count |
number |
Number of resources requested during each view load |
view_long_task_count |
number |
Number of long tasks generated during each view load |
view_action_count |
number |
Number of actions during the view viewing process |
view_update_time |
number |
Number of View updates |
view_long_task_rate |
number |
Proportion of time spent on long tasks during the View |
Monitoring Metrics
| Field |
Type |
Description |
cpu_tick_count |
number |
Optional, CPU tick count for this view |
cpu_tick_count_per_second |
number |
Optional, average CPU ticks per second |
fps_avg |
number |
Optional, average frames per second for the view |
fps_mini |
number |
Optional, minimum frames per second for the view |
memory_avg |
number |
Optional, average memory usage for the view |
memory_max |
number |
Optional, peak memory usage for the view |
Resource
View Attributes
| Field |
Type |
Description |
view_id |
string |
Unique ID generated each time a view is accessed |
view_referrer |
string |
View source, the parent of the view |
view_name |
string |
View name |
Action Attributes
| Field |
Type |
Description |
action_id |
string |
Unique ID generated when the user performs an action on a view |
action_name |
string |
Action name |
action_type |
string |
Action type (cold/warm start, click, etc.) |
Resource Attributes
| Field |
Type |
Description |
resource_url |
string |
Resource URL |
resource_url_host |
string |
Host 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 type |
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 of the resource URL |
resource_id |
string |
Unique ID of the resource request |
response_connection |
string |
Value of the Connection response header |
response_content_type |
string |
Value of the Content-Type response header |
response_content_encoding |
string |
Value of the Content-Encoding response header |
span_id |
string |
Span ID associated with the trace |
trace_id |
string |
Trace ID associated with the trace |
session_has_replay |
boolean |
Whether the session to which the current Resource belongs is associated with Session Replay data |
Metrics
| Field |
Type |
Description |
resource_size |
number |
Resource size, default unit: byte |
resource_request_size |
number |
Resource request 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) |
Time to first byte for resource loading Calculation: responseStart - requestStart |
resource_trans |
number(ns) |
Content transfer time for resource loading Calculation: responseEnd - responseStart |
resource_first_byte |
number(ns) |
First byte time for resource loading Calculation: responseStart - domainLookupStart |
duration |
number(ns) |
Resource loading time Calculation: duration(responseEnd - startTime) |
resource_dns_time |
object |
DNS phase duration, structure: {start, duration} |
resource_connect_time |
object |
TCP connection phase duration, structure: {start, duration} |
resource_first_byte_time |
object |
First byte phase duration, structure: {start, duration} |
resource_ssl_time |
object |
SSL phase duration, structure: {start, duration} |
resource_download_time |
object |
Download phase duration, structure: {start, duration} |
resource_redirect_time |
object |
Redirect phase duration, structure: {start, duration} |
resource_http_protocol |
string |
Network protocol used by the resource request |
resource_connection_reuse |
boolean |
Whether the resource request reuses the connection |
request_header |
string |
Resource request header |
response_header |
string |
Resource response header |
Network Snapshot
| Field |
Type |
Description |
network_available |
boolean |
Whether the network is available at the start of the Resource |
Error
View Attributes
| Field |
Type |
Description |
view_id |
string |
Unique ID generated each time a view is accessed |
view_referrer |
string |
View source, the parent of the view |
view_name |
string |
View name |
Action Attributes
| Field |
Type |
Description |
action_id |
string |
Unique ID generated when the user performs an action on a view |
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: anr_error | ios_crash network error type: network_error |
error_situation |
string |
Timing of the error, reference values: startup (during startup) and run (during runtime) |
session_has_replay |
boolean |
Whether the session to which the current Error belongs is associated with Session Replay data |
When type=network, the following additional Network Error attributes are added.
| Field |
Type |
Description |
resource_id |
string |
Unique ID of the resource request |
resource_status |
string |
Status value returned by the resource request |
resource_url |
string |
Resource URL |
resource_url_host |
string |
Host 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_status_group |
string |
Status group value returned by the resource request |
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 (not supported by tvOS) |
carrier |
string |
Optional, carrier information (supported by iOS) |
locale |
string |
Current system language |
Metrics
| Field |
Type |
Description |
error_message |
string |
Error message |
error_stack |
string |
Error stack trace |
foreground_crash_free_duration |
number(ns) |
Crash-free duration in the foreground before the crash occurred |
background_crash_free_duration |
number(ns) |
Crash-free duration in the background before the crash occurred |
crash_extra |
object |
Additional crash information, e.g., register information |
Long Task
View Attributes
| Field |
Type |
Description |
view_id |
string |
Unique ID generated each time a view is accessed |
view_referrer |
string |
View source, the parent of the view |
view_name |
string |
View name |
Action Attributes
| Field |
Type |
Description |
action_id |
string |
Unique ID generated when the user performs an action on a view |
action_name |
string |
Action name |
Metrics
| Field |
Type |
Description |
duration |
number(ns) |
Duration of the lag |
long_task_stack |
string |
Stack trace of the lag |
session_has_replay |
boolean |
Whether the session to which the current Long Task belongs is associated with Session Replay data |
Action
View Attributes
| Field |
Type |
Description |
view_id |
string |
Unique ID generated each time a view is accessed |
view_referrer |
string |
View source, the parent of the view |
view_name |
string |
View name |
Action Attributes
| Field |
Type |
Description |
action_id |
string |
Unique ID generated when the user performs an action on a view |
action_name |
string |
Action name, default launch actions include app_hot_start, app_cold_start, app_warm_start |
action_type |
string |
Action type, reference values include: click, launch_hot, launch_cold, launch_warm |
session_has_replay |
boolean |
Whether the session to which the current Action belongs is associated with Session Replay data |
Metrics
| Field |
Type |
Description |
duration |
number(ns) |
Time spent on the action |
app_pre_runtime_init_time |
object |
Launch phase metric, time before runtime initialization, structure: {start, duration} |
app_runtime_init_time |
object |
Launch phase metric, runtime initialization time, structure: {start, duration} |
app_uikit_init_time |
object |
Launch phase metric, UIKit initialization time, structure: {start, duration} |
app_application_init_time |
object |
Launch phase metric, Application initialization time, structure: {start, duration} |
app_first_frame_init_time |
object |
Launch phase metric, first frame rendering time, structure: {start, duration} |
app_launch_type |
string |
Cold start type, only reported when action_type=launch_cold, reference values: foreground, background |
Aggregated 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 |
WebView Association
When WebView JSBridge data is ingested into RUM, the SDK adds is_web_view=true to the corresponding data to indicate that the data comes from a WebView. WebView data fields are primarily based on the fields reported by the Web SDK, and only this association description is retained in the native iOS field table.