How do I enable real user monitoring?

Real user monitoring is automatically enabled for all detected applications and all applications are detected by default—so no setup is necessary. 

In rare circumstances, the Dynatrace JavaScript tag that is injected into each application page can have an adverse impact on application functionality. For this reason, following installation of Dynatrace OneAgent confirm that your application’s pages still render properly. If some of your application’s pages appear to be corrupted, disable monitoring and contact us at Dynatrace Answers.

Why don’t I see my applications or monitoring data?

If you don’t see any of your applications or real user monitoring data in Dynatrace, the first thing you need to do is confirm that there is traffic in your web front-end processes (web server, Java, Node.js, etc). To do this, interact with one of your applications’ pages to generate some traffic.

Once you’re certain that your web front-end processes have traffic on them, check to see if the JavaScript tag has been injected into your application pages’ HTML. To do this, view the source of one of your application’s pages and look for the string /ruxitagentjs.  If you see this string than you know that the JavaScript tag has been correctly injected. If you don’t see the string /ruxitagentjs in your HTML source code, then it may be that the web front-end process of your application is not monitored.

To confirm that your application’s web front-end process is monitored, go to Settings > Monitoring overview > Processes and search for the process. All monitored processes are listed on this page. 

In rare circumstances the JavaScript tag injection may not work because of poorly formatted HTML in the application. If the JavaScript tag has been correctly inserted into the HTML, but you still don’t see real user monitoring data such as application metrics, it may be that a firewall is blocking the signal that is sent by the DynatraceJavaScript tag back to your server process.

Can I test that the monitor signal passes through my infrastructure?

To confirm that the monitor signal is correctly passing through your infrastructure, call the URL: 
<your hostname>/rx_<ID>?$

If the request returns the value OK (along with other text and HTTP status), then you know that the beacon signal is passing through your servers and you should be receiving real user monitoring data. 

If these suggestions don’t resolve your issue, please post your question to Dynatrace Answers where one of our product gurus can assist you. 

Advanced real user monitoring setup

If you’re not able to install Dynatrace OneAgent using the standard monitoring setup approach, you will have to enable real user monitoring for your application by manually inserting a custom JavaScript tag into each of your application’s pages and downloading a corresponding JavaScript library file. This approach to monitoring is known as agentless real user monitoring.

Normally you benefit from real user monitoring only after you’ve installed Dynatrace OneAgent. The manual approach to setup described here—otherwise known as agentless real user monitoring—should only be used for installations where you aren’t able to start deep monitoring, for example because you have no Dynatrace OneAgent installed on your web server machine.

Before you begin:

  • Keep in mind that you’ll need to manually insert a JavaScript tag into each of your application’s pages.
  • You may find it challenging to insert the JavaScript tags in the right places (this is something that Dynatrace OneAgent handles automatically).
  • The JavaScript tags embedded in your application’s pages will not be automatically updated if you change application monitoring settings—you’ll need to update the tags manually (this is something that Dynatrace OneAgent handles automatically).

What you’ll need:

  • Access to your application’s HTML source so that you can insert the JavaScript tags.
  • Custom JavaScript tag generated by Dynatrace.

Setting up real user monitoring without Dynatrace OneAgent:

Note: Agentless monitoring is appropriate for environments where you can’t install an agent on your web server. If you do have web server access, it’s recommended that you use the standard monitoring setup instead. 

Add an application to your Dynatrace environment by selecting Set up agentless monitoring from the menu.
Note: If you already have an application set up for agentless monitoring, you can skip steps 2 & 3 below by copying an existing JavaScript snippet. To do this, click the copy an existing JavaScript tag link to view the list of currently set up applications and corresponding JavaScript snippets. This is useful if you’ve already added real user monitoring code to some of your pages and want to extend monitoring visibility to other pages. 

Type in your application’s domain name.

Click Add web application
A custom JavaScript tag for your application is then displayed.

Select and copy your application’s custom JavaScript tag to the clipboard.

Paste the JavaScript tag from the clipboard into each of your application’s HTML pages that you want to monitor.

  • The script tag must be placed as the first JavaScript file in the page.
  • The script tag is updated each time you make a change to your application’s settings, so be sure that you insert the current version of the tag.

Dynatrace waits for you to modify your pages’ code and then to see traffic on the website. You can finish here or wait to see if everything’s fine.

Once page code changes have been deployed, you should begin to see monitoring data within a few minutes.

Example: simple page code before and after real user monitoring tag insertion

Before injection

<html>
<head>
    <title>MyApp</title>
    <script type="text/javascript" src="myapp.js"></script>
</head>

<body>

<form>
    Username: <input type="text name="username"/><br/>
    Password: <input type="password" name="password"/><br/>
    <input type="submit" value="Login">
</form>

After injection

<html>
<head>
    <title>MyApp</title>
    <script type="text/javascript" src="//js-cdn.dynatrace.com/jstag/145e12d594f/ruxitagentjs_2nr_1006400120011129.js" data-dtconfig="tp=500,50,0,0,10"></script>
    <script type="text/javascript" src="myapp.js"></script>
</head>

<body>

<form>
    Username: <input type="text name="username"/><br/>
    Password: <input type="password" name="password"/><br/>
    <input type="submit" value="Login">
</form>