Mobile RUM
Introduction
Mobile RUM provides end-to-end visibility into how users interact with mobile applications, capturing performance data, user actions, and network requests in real-time. It enables teams to understand user experience across different devices and platforms, helping to identify performance bottlenecks, crashes, and behavioral trends for a complete picture of the mobile user journey.
Getting Started
Compatibility
Minimum target compatibility for Android is, Android 7.0 (API level 24) Flutter is, Flutter SDK version 3.29.2 and dart 3.7.2
Data Collection Method
GSH Overview
Mobile RUM collects real user monitoring data using VuNet’s Mobile SDKs.
The recommended approach is to deploy a proxy server in the DMZ to receive telemetry from users' mobile applications. This proxy serves as a secure intermediary between the end-user mobile application (where the RUM agent executes) and the RUM data collector of the observability platform hosted within the internal network.
Prerequisites
Inputs for Configuring Data Source
To configure this data source, you will require the following parameters:
Key
Help Text
Application Name
Enter the name of the application you want to monitor.
Certificate:
Mobile-to-Proxy SSL Certificate: Used to establish secure connections between the Mobile application and the proxy server.
vuSmartMaps Certificate: Required for secure communication between the proxy server and the RUM collector.
CORS
To ensure successful communication between the application and the proxy server, the following CORS-related requirements must be met:
Restrict Origins: Only trusted application domains should be allowed to send data. The proxy server must be configured to whitelist specific origins using the following headers:
Access-Control-Allow-Origin: https://<appname.com>
Replace https://<appname.com> with the actual domain(s) of your frontend application.
Security Mechanism Compatibility: If the application uses security mechanisms such as CSP (Content Security Policy) or firewalls, they must be configured to allow communication with the proxy.
CSP headers must permit connect-src access to the proxy domain:
Content-Security-Policy: script-src 'self'; connect-src 'self' https://<proxy_address>;
Ensure the proxy's hostname (e.g., https://otelproxy.com) is included in the connect-src directive.
Preflight Request Support: The proxy must correctly handle preflight OPTIONS requests. These requests are automatically issued by mobiles before a POST request to verify CORS permissions.
Ensure your NGINX or proxy server returns the appropriate CORS headers for OPTIONS requests.
The Role of the Proxy Server in Mobile RUM
The proxy server is a critical component in a Real User Monitoring (RUM) deployment. It acts as a secure intermediary between end-user mobile applications (where the RUM agent runs) and the backend RUM data collector. Integrating a proxy server provides the following technical benefits:
SSL/TLS Termination: The proxy server terminates HTTPS connections, ensuring encrypted and trusted transmission of RUM data from mobiles.
CORS Enforcement: It manages Cross-Origin Resource Sharing (CORS) headers, allowing only requests from approved frontend domains to be processed, which protects against cross-site data leaks.
API Key and Authorization Validation: Incoming requests are checked for valid API keys or authorization tokens. Unauthorized requests are rejected, ensuring only trusted clients can send monitoring data.
Request Routing and Load Balancing: The proxy server forwards accepted telemetry data to the correct backend RUM collector endpoint and can distribute load across multiple backend instances for high availability.
Network Security: Only the proxy is exposed to the internet. The backend RUM collector stays protected within a private network, and firewall rules only need to allow access to the proxy.
Client IP Forwarding: To enable accurate user attribution, the proxy passes the original client IP address to the backend using headers such as X-Forwarded-For.
Preflight and OPTIONS Handling: The proxy handles mobile CORS preflight (OPTIONS) requests, which is essential for seamless communication from modern mobile.
Security Headers Management: Additional security headers (like Strict-Transport-Security and X-Frame-Options) can be injected to enhance security.
Prerequisites
Inputs for Configuring Data Source
- Application Name: Enter the name of the application you want to monitor
Firewall Requirement
To collect data from this O11ySource, ensure the following ports are opened:
| Source IP | Destination IP | Destination Port | Protocol | Direction |
|---|---|---|---|---|
| Mobile Application | Proxy Server | 443 | TCP | Inbound |
| Proxy Server | vuSmartMaps OTEL Collector | 4321, 4322* | TCP | Outbound |
*Before providing the firewall requirements, please update the port based on the customer environment.
Configuring the Target
GSH Overview
Client Side Mobile RUM Instrumentation
Instrumenting Mobile Applications
Modify the application's front end code to include Vunet's RUM SDK for mobile. The complete instructions will be available in the following documents for the respective technology.
instrumentation steps for Flutter
instrumentation steps for Android
Configuration Steps
GSH Overview
- *``
Enable
``**
the Mobile RUM O11ySource.
Select the sources tab and press the
- *``
+
``**
button to add a new application that has to be monitored.
Provide the required configurations:
Application Name
Afterwards, select
- *``
Save and Continue
``**
to proceed with downloading the Flutter instrumentation SDK package. Android Native does not require any download, it pulls the SDK from Maven repository once the SDK names are specified as pet the guide follows
Then click
- *``
Finish
``**
to close the data source window.
Metrics Collected
| Name | Description | Data Type |
|---|---|---|
| is_root_span | Indicates if the span is a root span. | Bool |
| span_attributes_count | Number of attributes associated with the span. | UInt8 |
| resource_attributes_service_name | Name of the resource's service. | LowCardinality(String) |
| spanId | Unique identifier for the span. | String |
| span_attributes_event_name | Name of the event associated with the span. | String |
| span_attributes_activityName | Name of the activity associated with the span. | String |
| span_attributes_os_name | Name of the operating system. | LowCardinality(String) |
| span_attributes_os_security_patch | OS security patch version. | LowCardinality(String) |
| span_attributes_os_type | Type of the operating system (e.g., Linux, Windows). | LowCardinality(String) |
| span_attributes_os_version | Version of the operating system. | LowCardinality(String) |
| span_attributes_device_manufacturer | Manufacturer of the device. | LowCardinality(String) |
| span_attributes_device_model_identifier | Unique identifier for the device model. | LowCardinality(String) |
| span_attributes_device_model_name | Name of the device model. | LowCardinality(String) |
| span_attributes_os_description | Description of the OS. | String |
| span_attributes_android_type | Type of Android device (e.g., phone, tablet). | String |
| span_attributes_app_name | Name of the app associated with the span. | String |
| span_attributes_app_version_name | Version name of the app. | String |
| span_attributes_app_version_code | Version code of the app. | String |
| span_attributes_http_request_method | HTTP method (GET, POST, etc.) used in the request. | String |
| span_attributes_http_response_status_code | HTTP status code of the response. | UInt32 |
| span_attributes_cls | CLS (Cumulative Layout Shift) value for the page. | UInt64 |
| span_attributes_http_client_ip | Client’s IP address from the HTTP request. | String |
| span_attributes_instrumentation_library_name | Name of the instrumentation library. | String |
| span_attributes_userId | User Id | String |
| span_attributes_network_carrier_icc | ICC (International Carrier Code) for the carrier. | String |
| span_attributes_network_carrier_mcc | Mobile Country Code of the network carrier. | String |
| span_attributes_network_carrier_mnc | Mobile Network Code of the network carrier. | String |
| span_attributes_network_carrier_name | Name of the network carrier. | String |
| span_attributes_network_connection_type | Type of network connection (e.g., WiFi, 4G). | String |
| span_attributes_network_peer_address | Address of the network peer. | String |
| span_attributes_network_peer_port | Port number of the network peer. | UInt32 |
| span_attributes_network_protocol_version | Version of the network protocol used. | String |
| span_attributes_server_address | Address of the server handling the span. | String |
| span_attributes_server_port | Port number of the server. | UInt32 |
| span_attributes_screen_name | Name of the screen in the app. | String |
| span_attributes_session_id | Unique identifier for the session. | String |
| span_exception_stacktrace | Full stack trace of the exception. | String |
| span_exception_type | Type of the exception encountered. | String |
| span_exception_message | Message of the exception. | String |
| span_attributes_error_type | Type of error encountered during span execution. | String |
| span_attributes_url_full | Full URL of the request made. | String |
| span_durationNano | Duration of the span in nanoseconds. | UInt64 |
| span_exception_time | Timestamp when the exception occurred. | DateTime64(3) |
| span_end_time | Timestamp when the span ended. | DateTime64(3) |
| span_attributes_start_type | Type of the span start (manual, automatic, etc.). | String |
| span_kind | Kind of span (client, server, etc.). | String |
| span_name | Name of the span. | String |
| span_parentSpanId | ID of the parent span. | String |
| span_start_time | Timestamp when the span started. | DateTime64(3) |
| status_code | Status code indicating the result of the span. | UInt8 |
| timestamp | The timestamp of when the span was recorded. | DateTime64(3) |
| traceId | Unique identifier for the trace. | String |
| city_name | City name from the geographical location. | String |
| region_name | Region name from the geographical location. | String |
| longitude | Longitude of the geographical location. | Float32 |
| timezone | Time zone of the geographical location. | String |
| latitude | Latitude of the geographical location. | Float32 |
| country_name | Country name of the geographical location. | String |
| logs_attributes_android_type | Type of the Android device (e.g., phone, tablet). | String |
| logs_attributes_app_name | Name of the app associated with the log. | String |
| logs_attributes_app_version_name | Version name of the app. | String |
| logs_attributes_exception_message | Message of the exception encountered. | String |
| logs_attributes_exception_type | Type of the exception encountered. | String |
| logs_attributes_heap_free | Free heap memory in bytes. | UInt64 |
| logs_attributes_storage_free | Free storage space in bytes. | UInt64 |
| logs_attributes_battery_percent | Battery percentage of the device. | UInt8 |
| logs_attributes_os_security_patch | Security patch version of the operating system. | String |
| logs_attributes_app_version_code | Version code of the app. | String |
| logs_attributes_event_name | Name of the event associated with the log. | String |
| logs_attributes_screen_name | Name of the screen in the app. | String |
| logs_attributes_session_id | Unique identifier for the session. | String |
| message | Log message content. | String |
| resource_attributes_device_manufacturer | Manufacturer of the device. | String |
| resource_attributes_device_model_identifier | Unique identifier for the device model. | String |
| resource_attributes_device_model_name | Name of the device model. | String |
| resource_attributes_os_description | Description of the operating system. | String |
| resource_attributes_os_name | Name of the operating system. | String |
| resource_attributes_os_type | Type of the operating system (e.g., Linux, Windows). | String |
| resource_attributes_os_version | Version of the operating system. | String |
| resource_attributes_rum_sdk_version | Version of the RUM SDK used. | String |
| resource_attributes_service_name | Name of the service associated with the log. | String |
| resource_attributes_telemetry_sdk_language | Language used in the telemetry SDK. | String |
| resource_attributes_telemetry_sdk_name | Name of the telemetry SDK used. | String |
| resource_attributes_telemetry_sdk_version | Version of the telemetry SDK used. | String |
| severity_number | Numeric severity level of the log. | UInt32 |
| severity_text | Text description of the severity level. | String |
| spanId | Unique identifier for the span. | String |
| timestamp | Timestamp when the log entry was created. | DateTime64(3) |
| timestamp_rum | RUM timestamp when the log entry was recorded. | DateTime64(3) |
| traceId | Unique identifier for the trace. | String |
| logs_attributes_exception_stacktrace | Full stack trace of the exception. | String |
