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 Real User Monitoring (RUM) includes six data types:
The RUM data types reported directly 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, access data related to user pages, resources, actions, errors, and long tasks is aggregated at the session level. |
| view |
Each time a user visits a page in the mobile application, a view record is generated. While the user stays on the same page, resource, long task, error, and action records are linked to the associated RUM view through the view_id attribute. |
| resource |
Records information about resources loaded when the user visits a page. |
| error |
Errors or crashes emitted 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 (application launch, tap, swipe, back, etc.). Each action is attached with a unique action_id. |
Global Attributes
RUM scenario construction and event alerts can both be queried using the following global attributes.
SDK Attributes
| Field |
Type |
Description |
sdk_name |
string |
Collector name. Fixed values:
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 user access application, automatically generated when you create the 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. 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 values:
df_rum_ios
df_rum_tvos
df_rum_android
df_rum_windows
df_rum_linux |
User & Session Attributes
| Field |
Type |
Description |
userid |
string |
For unauthenticated users, a random UUID is used as the userid; for logged-in users, the user ID generated by the application backend is used. |
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. |
session_start_reason |
string |
SDK 1.6.8+: reason for session start or update in RUM events. sdk_init: SDK initialization; inactivity_timeout: session inactivity timeout exceeded; max_duration: maximum session duration reached; sampling_changed: sampling configuration changed; unknown: reason unknown. This field belongs to the session context and does not mean the SDK reports Session data separately. |
is_signin |
boolean |
Whether the user is a registered user. Values: T & F. |
session_has_replay |
boolean |
Whether the current session is associated with Session Replay data. After Session Replay capabilities are enabled, View, Resource, Error, Long Task, and Action can write to this field. |
visitor_id |
string |
SDK 1.6.8+: anonymous identifier managed by the SDK after the Visitor ID configuration is enabled; it differs from the logged-in user ID. See Visitor ID |
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 mobile device ID, generated using UIDevice.identifierForVendor |
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 |
CPU architecture, e.g., arm64, arm64e, x86_64 |
Geography & Network Attributes
| Field |
Type |
Description |
ip |
string |
User access IP address |
isp |
string |
ISP |
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 custom tag data) to build scenarios and configure event alerts. Custom attributes are non-global attributes. With custom attributes, you can track the entire process of user access to the application, locate and discover affected user visits, and monitor user access performance.
Attributes of Other Data Types
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 reported directly by the iOS SDK alone.
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 synthetic tests. |
session_referrer |
string |
Session referrer. Usually records the page address of the source. |
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 page visited in the current session |
session_last_view_name |
string |
URL of the last page in 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 |
session_has_replay |
boolean |
Whether the session to which the current View belongs is associated with Session Replay data |
app_state |
string |
SDK 1.6.8+: application state calculated from the foreground/background history between the load start point (falls back to the View start when not provided) and the current snapshot event time. Values: foreground (foreground only), background (background only), foreground_and_background (passed through both foreground and background), unknown (missing history or invalid interval) |
Metrics
| Field |
Type |
Description |
loading_time |
number(ns) |
Page loading time |
interaction_to_next_view_time |
number(ns) |
SDK 1.6.8+: the start time of the current View minus the start time of the most recent qualified Action in the immediately preceding View within the same Session; click is matched by default, with the interval in [0, 3 seconds]. Not present when there is no qualified Action, the data is filtered, or it belongs to a fallback View; no association is made across Sessions. Missing does not equal 0, and a legitimate zero duration can be reported. See Matching Rules and Examples |
network_settled_time |
number(ns) |
SDK 1.6.8+: the latest valid end time of the initial request minus the View start time (not the load start point); by default, requests started within [0, 100ms] after the View starts are selected, rather than waiting for 100ms of network idle time. Completed batches can produce and update results, and subsequent View snapshots carry the current value. Not present when there is no valid request interval, the data is filtered, the interval spans background state, state history is missing, or it belongs to a fallback View; missing does not equal 0, and a legitimate zero duration can be reported. See Matching Rules and Examples |
time_spent |
number(ns) |
Time spent on the page |
is_active |
boolean |
Indicates 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 supplementary sampling after an error occurs when the RUM Session sampling is not hit |
session_replay_sample_rate |
number |
Session Replay sampling rate. Present after Session Replay capabilities are enabled |
session_replay_on_error_sample_rate |
number |
Sampling rate for supplementary Session Replay sampling after an error occurs. Present after Session Replay capabilities are enabled |
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) |
Time when the error occurred that hit the error sampling |
session_replay_stats |
object |
Session Replay statistics associated with the current View |
Statistical Metrics
| Field |
Type |
Description |
view_error_count |
number |
Number of errors that occur on each page load |
view_resource_count |
number |
Number of resources requested on each page load |
view_long_task_count |
number |
Number of long tasks generated on each page load |
view_action_count |
number |
Number of actions during page viewing |
view_update_time |
number |
Number of View updates |
view_long_task_rate |
number |
Proportion of long task duration during the 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 for the page |
fps_mini |
number |
Optional. Minimum frames per second for 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 the user performs a page action |
action_name |
string |
Action name |
action_type |
string |
Action type (cold/hot launch, click, and other actions) |
Resource Attributes
| Field |
Type |
Description |
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_query |
string |
Query 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 |
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 of the associated trace |
trace_id |
string |
Trace ID of the associated trace |
session_has_replay |
boolean |
Whether the session to which the current Resource belongs is associated with Session Replay data |
app_state |
string |
SDK 1.6.8+: application state calculated from the foreground/background history within the request start-to-end interval normalized on the collection side. Values: foreground (foreground only), background (background only), foreground_and_background (passed through both foreground and background), unknown (missing history or invalid interval) |
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) |
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_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 a connection |
request_header |
string |
Resource request headers |
response_header |
string |
Resource response headers |
Network Snapshot
| Field |
Type |
Description |
network_available |
boolean |
Whether the network is available when the Resource starts |
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 a page action |
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: anr_error | ios_crash network error type: network_error |
error_situation |
string |
Timing of the error occurrence. Reference values: startup (at startup) and run (at 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 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 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_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 |
cpu_use |
number |
Optional. CPU usage |
battery_use |
number |
Optional. Current phone battery level (not supported on tvOS) |
carrier |
string |
Optional. Carrier information (supported on iOS) |
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) |
Crash-free duration while the application was in the foreground before the crash |
background_crash_free_duration |
number(ns) |
Crash-free duration while the application was in the background before the crash |
crash_extra |
object |
Additional crash information, such as register information |
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 a page action |
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 session to which the current Long Task belongs is associated with Session Replay data |
app_state |
string |
SDK 1.6.8+: the interval is determined by the event start time and duration, and the application state is calculated from the foreground/background history within that interval. Values: foreground (foreground only), background (background only), foreground_and_background (passed through both foreground and background), unknown (missing history or invalid interval) |
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 a page action |
action_name |
string |
Action name. Default launch actions include app_hot_start, app_cold_start, and 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 page action |
app_pre_runtime_init_time |
object |
Launch phase metric. Time spent before runtime initialization. Structure: {start, duration} |
app_runtime_init_time |
object |
Launch phase metric. Time spent on runtime initialization. Structure: {start, duration} |
app_uikit_init_time |
object |
Launch phase metric. Time spent on UIKit initialization. Structure: {start, duration} |
app_application_init_time |
object |
Launch phase metric. Time spent on Application initialization. Structure: {start, duration} |
app_first_frame_init_time |
object |
Launch phase metric. Time to render the first frame. Structure: {start, duration} |
app_launch_type |
string |
Cold launch type, reported only when action_type=launch_cold. Reference values: foreground, background |
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 |
WebView Association
When WebView JSBridge data is integrated 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; only this association note is retained in the native iOS field tables.