How do I set up agentless Real User Monitoring?

Normally you benefit from Real User Monitoring only after you’ve installed Dynatrace OneAgent. Agentless monitoring is meant to be used in cases that you don't have access to your web server and therefore you cannot install OneAgent. Otherwise installation of Dynatrace OneAgent is recommended for the following reason:

Note:

  • 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).

  • If you don't use the code snippet option (see below), 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 handles automatically).

Before you begin

What you'll need:

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

Set up agentless monitoring

Select Deploy Dynatrace from the navigation menu and then click Set up agentless or AMP monitoring. You can alternatively select Applications from the navigation menu, click Monitoring settings in the top right corner and select Set up agentless or AMP monitoring.

Type in your application’s domain name and click Add web application. A custom JavaScript snippet for your application is then generated.

Note:
You can switch on My application relies on Accelerated Mobile Pages (AMP) in case your page is an AMP page. This doesn't allow JavaScript to run on a page and aims at making mobile pages faster.

Click Copy code snippet to copy your application’s custom JavaScript snippet to the clipboard.

Paste the JavaScript snippet from the clipboard into each of your application’s HTML pages that you want to monitor. Dynatrace waits for you to modify your pages’ code and then to see traffic on the website.

Note:
If you already have an application set up for agentless monitoring, in step 2 you can click applications currently set up for agentless monitoring instead of typing in your application’s name. Then you will view the list of currently set up applications and corresponding JavaScript snippets. This is useful if you’ve already added the JavaScript tag to some of your pages and want to extend monitoring visibility to other pages.

Manual injection options

To view all the available manual injection options supported for agentless monitoring:

Select Applications from the navigation menu and then click an application for which the Injection type is Manually Injected (see filters in the left).

Click the Browse button (...) and select Edit.

In Setup, click Agentless Real User Monitoring setup.

Click the drop list under Insert monitoring code. The available manual injection options are the following:

  • Code snippet: It is the default option when setting up agentless monitoring for the first time (see above). It requires that you manually insert a code snippet into the HTML head of each application page. The snippet automatically loads the latest JavaScript code version and configuration. Therefore, you never need to update the code snippet.

  • Code snippet async: It requires that you manually insert a code snippet into the HTML head of each application page. The snippet asynchronously loads the latest JavaScript code version and configuration. This approach reduces impact on page load. However, visibility may be reduced as some XHR calls may be lost. Again, you never need to update the code snippet.

  • JavaScript tag: It requires that you manually insert a JavaScript tag into the HTML head of each application page. This approach is compliant with Content Security Policy. Keep in mind that you must update the tag each time you change the configuration or when new JavaScript code versions become available.

  • Inline code: It requires that you manually insert the full JavaScript code inline into the HTML head of each application page. Through this option, additional requests can be avoided. However, you must update this tag each time you change the configuration or when new JavaScript code versions become available.

CLick Download to download the selected option.

Notes:

  1. The above listed features are available for environments that have a minimum OneAgent version of v1.127 and above.
  2. You can use the Dynatrace API to fetch the latest JavaScript code for injection.

Example

The following example shows a simple page code before and after the JavaScript 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>