---
title: "Configuring RUM Agent"
canonical: "https://thoughtdata.refined.site/space/TUD/55481381/Configuring%20RUM%20Agent"
format: markdown
---
## Configuring Real User Monitoring(RUM) Agent


Real user monitoring (RUM) provides a passive approach to measure the end user experience of your website or web-based application by collecting and analyzing timing, errors and dimensional information on end users in real time. Real user monitoring helps website and application developers understand how their code and workflow design impacts page performance, user interaction and experience and other performance related issues.

Real user monitoring offers a comprehensive visibility into the performance of front end of your web application or website versus synthetic monitoring, which only measures availability, up-time and downtime of your website or web-based application. For example, an e-commerce website’s home page might be available, but the rest of the pages may deliver content or images slowly upon user interaction slowing down user experience. The web application may also be slow to process a user’s click or keystroke, which may result in abandonment of webpage by the frustrated user.

ThoughtData's RUM agent provides comprehensive visibility into performance of UI of your web based application service in real time as users interact with web based UI.

Instrumenting RUM agent requires some pre-requisite knowledge about your UI application and is typically performed by web administrators or developers. Setting up ThoughtData's RUM agent requires you to add a java script(JS) code snippet in your main web page HTML file. If you are using a session oriented web application adding the java script into the main web page is sufficient, If the website or web application UI is a discrete set of HTML files not connected by a session and only inter connected by HTML hyper links, then you would be required to the add the java script code snippet into each of the HTML files.

![image](media://ceb4b4f1-8824-4c87-b361-d7a2c1634a49)

Instrumenting RUM on your web application server

Refer to Figure 1 to understand, how the RUM agent works on your website or web application server. When users access your webserver as a part of your landing webpage the RUM java script gets invoked on your user computer browser. The RUM java script communicates to the Infrasense sensor and downloads a small RUM agent into the client browser for the period of that browser session. The RUM agent then captures all user interactions on your web application servers and records key telemetry about users experience and web servers performance. The RUM agent relays all this information to the Infrasense agent running on your network side. Once the user closes the browser session, RUM agent is also closed on the browser side. By default all communication is secured over HTTPs. 

Pre-requisites for RUM Monitoring

1. A pre-installed Infrasense Sensor virtual or physical based on your deployment needs
2. If your users are accessing your website or web application service over Internet(very common scenario), your Infrasense should have a dedicated Public IP assigned to it for RUM agent to communicate to your Infrasense
3. A proper resolvable DNS name assigned to the public IP of your Infrasense Sensor
4. Valid certificates for your Infrasense Sensor for HTTPs/SSL communication

**Note:** If you choose to opt for HTTP method than HTTPs, then DNS name and Certificate are not required.

Follow the steps below to enable RUM monitoring on your website or web application server.

Login to your web server (E.g.: tomcat/nginx/apache etc) as root/super user.

Locate the landing web page JS or HTML file(E.g.: Index.html, welcome.jsp, login.jsp etc).

Edit the landing web page or script

Add the below java script code snippet

 ***<script>***  
***
                   ;(function(d, s, c) {***  
***
                          var j = d.createElement(s),***  
***
                          t = d.getElementsByTagName(s)[0]***  
***
                          j.src = 'http://<infrasense-ip>/public/elastic-apm-rum.umd.min.js'***  
***
                          j.onload = function() {elasticApm.init(c)}***  
***
                          t.parentNode.insertBefore(j, t)***  
***
                  })(document, 'script', {serviceName: '<service name>', serverUrl: 'http://<infrasense-ip>'})***  
***
          </script>***

In the above snippet code, replace **<infrasense-ip>** with proper DNS name or public IP of your Infrasense sensor. Replace **<service-name>** with a proper web service app name by which you want to recognize the app in Enterprise360.

Recompile your web-application if required

Restart your web application service on your server.

This completes the configuration required on RUM agent side, however you will need to start the APM server process on the Infrasense sensor side to complete the RUM monitoring configuration if you haven't already.

Refer to [Configuring Infrasense sensor for APM/RUM agents](https://thoughtdata.atlassian.net/wiki/spaces/TUD/pages/55481377/Configuring+APM+server+in+Infrasense+for+APM+RUM+Agents) topic for more information to complete the steps in setting up your RUM Monitoring in Enterprise360

Related Topic

[Obtaining & configuring valid certificates for your Infrasense Sensor](https://thoughtdata.atlassian.net/wiki/spaces/TUD/pages/55186534/Obtaining+configuring+valid+certificates+for+your+Infrasense+Sensor)