Skip to main content
Version: NG-2.16

Browser RUM

Introduction

Browser Real User Monitoring (RUM) in vuSmartMaps captures frontend performance data from real user interactions. This helps in understanding actual user experience, debugging performance issues, and optimizing web application performance.

Getting Started

Compatibility

Browser RUM is supported for the following browsers/runtime:

  • Google Chrome (Version 131.0.6778.85 and above)

Data Collection Method

The Real User Monitoring data is collected by Vunet's JavaScript RUM Agent.

Prerequisites

Inputs for Configuring Data Source

  • app_name: Enter the name of the application you want to monitor.
  • service name: Enter the name of the service you want to monitor.

Firewall Requirement

To collect data from this O11ySource, ensure the following ports are opened:

Source IPDestination IPDestination PortProtocolDirection
Application ServervuSmartMaps DataCollector4319*TCPInbound

*Before providing the firewall requirements, please update the port based on the customer environment.

Configuring the Target

Modify the application's front end code to include Vunet's JavaScript RUM Agent using CDN or NPM based on your environment. The complete instructions can be downloaded as the package from the Browser RUM O11ySource.

Configuration Steps

Prerequisites

  1. A public access to Vunet RUM telemetry receiver.This is needed as the RUM scriptruns in the end user’s browser and it sends data to vuSmartMaps directly.You can also use a reverse proxy.
  2. The VuNet RUM telemetry receiver allow the cross-origin request from the application host.

Host

Following are steps to instrument the Java Script applications.

  1. Copy the rum.vunet.js to the application codebase. It is preferable to keep it in the js folder.
  2. Add the RUM script to your page header.
       <script> 


(function (w, s, d, r, e, n) {


(w[s] = w[s] || {


readyListeners: [],


onReady: function (e) {


w[s].readyListeners.push(e);


},


}),


((e = d.createElement('script')).async = 1),


(e.src = r),(n = d.getElementsByTagName('script')[0]).parentNode.insertBefore(e, n);


})(


window,


'sumoLogicOpenTelemetryRum',


document,


'rum.vunet.js', // add the instrumentation package in the project and mention thepath here.


);


window.sumoLogicOpenTelemetryRum.onReady(function () {


window.sumoLogicOpenTelemetryRum.initialize({


collectionSourceUrl: "<VUNET_TELEMETRY_RECEIVER_URL>", //mention the urlwhere the otel collector is running


serviceName: '<SERVICE_NAME>',// mention the service name of the application


applicationName: '<APPLICATION_NAME>', // mention the name of the application


samplingProbability: 1,


collectErrors: true,


});


});


</script>
  • Replace the VUNET_TELEMETRY_RECEIVER_URL with the URL of the VuNet telemetry receiver.
  • Replace the SERVICE_NAME with the service name that matches your environment.c. Replace the APPLICATION_NAME with the application name that matches your environment.
  1. Restart the web server

Container

Adding the RUM script to your page header is a code change.Please follow the steps mentioned in the above section and rebuild the docker container.

Kubernetes

Adding the RUM script to your page header is a code change. Please follow the steps mentioned in the above section and rebuild the docker container to use it with Kubernetes

Metrics Collected

NameDescriptionData Type
timestampEvent timeDateTime64
traceIdTrace IDString
spanIdIdentifier for the span within the traceString
span_parentSpanIdID of the parent span. Empty if the span is the root span in the traceString
span_nameLogical name of the operation that the span represents. documentLoad / resourceFetch / NavigationString
span_kindServer or Client or Internal or Producer or ConsumerString
span_start_timeStart timeDateTime64
span_end_timeEnd timeDateTime64
span_durationNanoDurationUInt64
status_codeStatus code for the span. 0 - Not set, 1 - OK, 2 - ErrorUInt8
is_root_spanIs root spanBool
resource_attributes_applicationApplication nameLowCardinality(String)
resource_attributes_service_nameService nameLowCardinality(String)
span_attributes_browser_nameClient’s BrowserLowCardinality(String)
span_attributes_os_nameClient’s OSLowCardinality(String)
span_attributes_http_urlURLString
span_attributes_instrumentation_library_nameLibrary used for instrumentation. This is useful to identify the application componentString
span_attributes_location_hrefThe caller URLString
span_attributes_rum_session_idSession IDString
span_attributes_dns_lookup_timeThe time taken to resolve the hostname for a target URLUInt64
span_attributes_tcp_connect_timeThe time taken to establish a TCP connection to the server (including SSL)UInt64
span_attributes_secure_connect_timeThe time taken to secure the connection established to the server. This includes the SSL handshake and SOCKSUInt64
span_attributes_request_timeThe time taken to request the page from the server until the first byte is received.UInt64
span_attributes_response_timeThe time taken to receive the responseUInt64