React Native Application Data Collection
Introduction
React Native data collection relies on the Android and iOS Native frameworks. To facilitate comparison with Android and iOS data collection, the items marked with strikethrough below are those not yet implemented.
Data Types
Guance Real User Monitoring (RUM) includes six data types.
| Type |
Description |
| session |
Records user session information. Within the current session, access data related to user pages, resources, actions, errors, and long tasks is collected on a session dimension. |
| view |
Each time a user visits a page in the mobile application, a view record is generated. When the user stays on the same page, records for resources, long tasks, errors, and actions are linked to the relevant RUM view via the view_id attribute. |
| resource |
Records information about resources loaded when a user visits a page. |
| error |
Records exceptions or crashes raised by the mobile application. |
long_task |
For any task that blocks the main thread for longer than a specified duration threshold in the application, a long task event is generated. |
| action |
Records user activity in the mobile application (e.g., app launch, tap, scroll, back). Each action is attached with a unique action_id. |
Global Attributes
Both scenario construction and event alerting in RUM can be queried using the following global attributes.
SDK Attributes
| Field |
Type |
Description |
sdk_name |
string |
Collector name. Fixed values:
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. The unique ID of the RUM application, automatically generated when creating a monitor in the Guance console. |
env |
string |
Required. Environment field. Valid 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. The name of the business or service. Fixed values:
df_rum_ios
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 userid; for authenticated 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. Valid values: user & synthetics user: Data generated by RUM functionality; synthetics: Data generated by headless synthetic tests. |
is_signin |
boolean |
Whether the user is a registered user. Valid values: T & F. |
Device & Resolution Attributes
| Field |
Type |
Description |
device |
string |
Mobile device manufacturer |
model |
string |
Mobile device model |
device_uuid |
string |
Unique device ID, generated using Android: ANDROID_ID, 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 |
Internet service provider |
network_type |
string |
Network connection type. Valid 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 custom tag data added by users) to build scenarios and configure event alerts. Custom attributes are non-global attributes. Using custom attributes, you can track the entire user visit process, locate and discover affected user visits, and monitor user visit performance.
Attributes for Other Data Types
Session
Attributes
| Field |
Type |
Description |
session_id |
string |
Session ID |
session_type |
string |
Session type. Valid values: user & test user: Data generated by RUM functionality; test: Data generated by headless synthetic tests. |
session_referrer |
string |
Session referrer. Typically records the URL of the source page. |
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_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 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 |
is_active |
boolean |
Indicates whether the user is still active. Valid values: true & false |
Aggregate 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_action_count |
number |
Number of actions performed during page 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 on the page |
fps_mini |
number |
Optional. Minimum frames per second on the page |
memory_avg |
number |
Optional. Average memory usage on the page |
memory_max |
number |
Optional. Peak memory usage on the page |
Resource
View Attributes
| Field |
Type |
Description |
view_id |
string |
Unique ID generated each time a page is visited |
is_active |
boolean |
Indicates whether the user is still active. Valid values: true & false |
view_referrer |
string |
Page referrer, the parent 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/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 |
Metrics
| Field |
Type |
Description |
resource_size |
number |
Resource size, default unit: bytes |
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) |
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 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/warm start, click, etc.) |
Error Attributes
| Field |
Type |
Description |
error_source |
string |
Error source. Valid values: logger | network |
error_type |
string |
Error type logger error types: reactnative_crash | java_crash | native_crash | anr_error | anr_crash | ios_crash network error type: network_error |
error_situation |
string |
Timing of the error occurrence. Valid 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 |
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_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 battery level |
locale |
string |
Current system language |
Metrics
| Field |
Type |
Description |
error_message |
string |
Error message |
error_stack |
string |
Error stack trace |
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 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/warm start, click, etc.) |
Metrics
| Field |
Type |
Description |
duration |
number (ns) |
Duration of the jank |
long_task_message |
string |
Jank information |
long_task_stack |
string |
Jank stack trace |
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 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/warm start, click, etc.) |
Metrics
| Field |
Type |
Description |
duration |
number (ns) |
Time spent on the page action |
Aggregate 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 |