Configure the Real User Monitoring code source

In the majority of RUM scenarios, at least one additional request for monitoring code is issued by the browser:

  • All snippet formats except for inline code (jsInlineScript) include monitoring code as an external resource, which is requested separately by the browser.
  • The monitoring code for Session Replay is always requested separately, even if the used tag format is inline code.

The default URL of the requested monitoring code depends on the injection method used for your application.

  • Agentless applications: If you opted for agentless monitoring, the monitoring code is requested from the Dynatrace CDN. In case of the tag format JavaScript tag (jsTagComplete), the filename ends with _complete.js and contains an application identifier (for example, 7cab1abeacdfe1_complete.js). For all other formats, it starts with ruxitagent_ and contains information about the active code modules and monitoring code version (for example, ruxitagent_ICA7NQVfqrtux_10307250124095659.js). The filename of the Session Replay monitoring code starts with ruxitagent_ (for example, ruxitagent_D_10307250124095659.js) for all tag formats.
  • Automatic injection: If the RUM JavaScript is injected automatically, both RUM and Session Replay monitoring code are requested from your web or application server using a root-relative URL where the filename starts with ruxitagentjs_ and contains information about the active code modules and monitoring code version (for example, /ruxitagentjs_ICA7NQVfqrtux_10307250124095659.js or /myapplication/ruxitagentjs_ICA7NQVfqrtux_10307250124095659.js).
  • Manual insertion for pages of an auto-injected application: If the RUM JavaScript is inserted manually even though your process groups are instrumented with OneAgent, the monitoring code, like with automatic injection, is requested from your web or application server using a root-relative URL where the filename starts with ruxitagentjs_. The only exception here is the tag format JavaScript tag (jsTagComplete), where the RUM monitoring code is requested from the CDN and the filename ends with _complete.js. The Session Replay monitoring code is requested from your web or application server and has a filename starting with ruxitagentjs_ for all tag formats.

While the monitoring code source for agentless cannot be configured, it is possible to do so for auto-injected applications. You usually don't need to do this, but there are certain scenarios where you might need to use an alternative configuration. For example:

  • If your infrastructure blocks monitoring code requests of an auto-injected application because of their default URL path.
  • If you prefer monitoring code requests not to be handled on the web or application server that hosts your application.

Auto-injected app Modify the monitoring code URL path

Depending on your infrastructure and its configuration, it's possible that requests for monitoring code can't pass with their automatically chosen URL path and thus can't be handled by OneAgent. To solve this, you can change the part of the URL that comes before the ruxitagentjs_ prefix.

To modify the RUM monitoring code URL path for an auto-injected application

  1. Go to Web.

  2. Select the application that you want to configure.

  3. In the upper-right corner of the application overview page, select More () > Edit.

  4. From the application settings, select Injection > Automatic injection.

  5. In the Real User Monitoring code source dropdown list, select OneAgent.

  6. In Specify path for RUM monitoring code, enter the relative monitoring code URL path.

    For example, if the monitoring code for your application is currently requested from /ruxitagentjs_ICA7NQVfqrtux_10307250124095659.js and you enter /custompath, it will be requested from /custompath/ruxitagentjs_ICA7NQVfqrtux_10307250124095659.js. You can't eliminate the ruxitagentjs_ICA7NQVfqrtux_10307250124095659.js part, which is necessary for the identification of the request as a monitoring code request.

This configuration is not only effective for automatic injection, but also for manual insertion for pages of an auto-injected application. The only exception is the _complete.js request for the JavaScript tag format, which will still go to the Dynatrace CDN.

Auto-injected app Request the monitoring code from the Dynatrace CDN

Note that all connected ActiveGates must be on ActiveGate version 1.310+ for at least 30 days before this feature becomes available.

If you want the monitoring code for an auto-injected application to be requested from the Dynatrace CDN instead of OneAgent, follow the steps below.

  1. Go to Web.
  2. Select the application that you want to configure.
  3. In the upper-right corner of the application overview page, select More () > Edit.
  4. From the application settings, select Injection > Automatic injection.
  5. In the Real User Monitoring code source dropdown list, select CDN.

This configuration is effective for both automatic injection and manual insertion for pages of an auto-injected application. Using it, filenames previously starting with ruxitagentjs_ will start with ruxitagent_ instead.