How can I verify that real user monitoring is working?

Real user monitoring (RUM) takes place in your customers’ web browsers. Web browser data is collected by means of a JavaScript tag that is placed inside the HTML of your application’s web pages. We call this JavaScript tag placement an “injection.”

If RUM doesn’t appear to be working in your environment, there are three things you can verify to determine the cause of the problem:

  • Check if the RUM JavaScript tag is included in your web application’s HTML.
  • Check if the RUM JavaScript tag has downloaded correctly.
  • Check if RUM monitoring data is being sent to Dynatrace.

If you’re unsure why you need to check all these things, have a look at How does real user monitoring injection work?

Confirm JavaScript tag injection

The first thing to do in verifying that real user monitoring has been set up correctly is to search for the Dynatrace JavaScript tag in your application’s HTML.

Load one of your pages, inspect its source in the web browser and check that the <head> element contains a reference to Dynatrace JavaScript:

For standard Dynatrace OneAgent installations (automatic tag injection)
Search for a script that contains the string ruxitagentjs in its file name.

<!‐‐ Example ‐ Auto injection of JavaScript tag ‐‐>
<script type="text/javascript" src="/ruxitagentjs_[...]_[...].js" data‐dtconfig="[...]"></script>

For agentless monitoring (i.e., no Dynatrace OneAgent, no automatic injection)
Search for a script that’s loaded from js.ruxit.com and ends with the string _bs.js

<!‐‐ Example ‐ Agentless monitoring JavaScript tag ‐‐>
<script type="text/javascript" src="https://js‐cdn.dynatrace.com/jstag/[...]/[...]/[...]_bs.js"></script>

Note: In the example above […] indicates a variable URL element such as an application ID and configuration parameter.

To confirm that real user monitoring has been set up correctly, search for the DynatraceJavaScript tag in your application’s HTML.

Confirm JavaScript tag download

The Dynatrace JavaScript tag for your application is downloaded along with all other web page resources. You can confirm that the download was successful using the development tools available in your browser (for example DevTools in Chrome) or with a tool like Fiddler or Firebug.

To begin, load your application’s page in a browser, then open your preferred development tool and go to the Network or Net section. There you’ll see the list of network operations and their statuses (you may need to reload the page to clear the view). Look for the following:

  • Responses that contain JavaScript code.
  • Responses must have status 200 "OK" or 304 "not modified". The script file may come from cache.
  • The existence of the JavaScript object dT_.
    To do this, go to your browser developer console and type dT_ and press [Enter]. As a result you should see an object returned.

See examples below for Google Chrome:

Properly downloaded Dynatrace JavaScript tag.
Server response containing the right script content.

There are a few reasons why a JavaScript tag may not be downloadable:

  • For agentless monitoring

    • The tag isn’t correct.
    • Content Security Policy rules prevent loading of the tag.
    • https://js-cdn.dynatrace.com hosting RUM JavaScript isn’t reachable for client browsers due to firewall rules or proxy server configuration. You’ll need to allow connections to and from https://js-cdn.dynatrace.com .
  • For automatic injection on web servers

    • Rules on firewalls, load balancers, or proxies aren’t configured to allow Dynatrace JavaScript download.
  • For automatic injection on Java application servers

    • Root application doesn’t exist. The JavaScript tag is usually loaded from the web server root path (.../ruxitagentjs_...)
    • Your Java application server serves static content in a way that doesn’t use the servlet stack. In such cases the JavaScript tag can’t be downloaded.

To resolve a JavaScript download issue caused by a missing root application:

  1. On the Dynatrace homepage, click the Applications tile.
  2. Select the application you want to configure.
  3. Click Edit on the menu bar.
  4. Click Advanced setup and scroll to JavaScript library.
  5. Specify the source path for placement of your application’s JavaScript library file in the Specify location for JavaScript library file field. This path needs to point to a location where the JavaScript agent is accessible (for example, a valid servlet path). See example below:
Specify the source path for placement of your application’s JavaScript library file.

Confirm the JavaScript tag reports data to server

The JavaScript tag reports back data via XHR or CORS post requests. You can view these requests among network operations using browser development tools.

For agentless monitoring
CORS requests to the Dynatrace infrastructure should be visible. Look for the following:

  • URL pattern: http(s)://[...].live.dynatrace.com/bf
  • Responses must have status 200 "OK" and response content must start with “OK”. See example below:

For automatic injection
XHR requests back to the server-side agent should be visible. Look for the following:

  • URL is relative to the current page location and begins with rb_
  • Responses must have status 200 "OK" and response content must start with “OK”. See example below:

Possible reasons for failure

The reasons for this are similar to the reasons why the JavaScript tag might not be downloaded:

  • Rules on firewalls, load balancers, or proxies may need to be adapted.
  • Content Security Policy settings may need to be adapted.
  • Java application server setup may need to be adapted.

Agentless monitoring:
It may be that your browser doesn’t support CORS requests. Data can be reported only via browsers that support CORS.