18 Nov 2025
07:25 AM
- last edited on
18 Nov 2025
07:52 AM
by
MaciejNeumann
Hello everyone,
We are using RUM on different applications and sometimes we face issues with the JS injection - it cases certain pages to load tremendously slower - for example a page loads in some ms and when we get the issue with the injection it starts loading for 20-30-50s. When we disable the injection the page starts loading normally again. These issues are handled by our Dynatrace consultants and they get resolved eventually, but as an internal Dynatrace admin I am trying to understand how and why this happens.
Can someone explain what might be causing this and is there a way to prevent the RUM injections to affect application performance? I would be really happy to see what is your experience with this and also how you were able to mitigate it.
Thanks in advance!
18 Nov 2025 08:23 AM
Hi,
here we can have few different scenario 😉
In general, the RUM JavaScript itself adds only a very small overhead (one extra script download + beacon calls). If you see page load jumping from a few ms to 20–50 seconds, it usually means there is an interaction issue rather than the “cost” of the RUM code itself.
There are a few typical patterns we’ve seen:
First is blocking load of ruxitagent.js or the beacon endpoint
The agent script is injected as the first <script> in <head>. If DNS, proxies, firewalls or ad-blockers slow down or block access to the Dynatrace cluster/ActiveGate, the browser may wait a long time before continuing to parse and execute the rest of the page.
– Check the Network waterfall with and without RUM and look at the timing of ruxitagent.js and the beacon requests.
– Make sure the agent and beacon are served via a fast, nearby endpoint (for example a close ActiveGate) and that the Dynatrace domains are white listed.
– For manual/agentless RUM, you can use an inline + deferred snippet to reduce the impact on page load.
Other scenario, script order / fragile application code
Because RUM tries to run as early as possible, it changes the script execution order slightly. On pages with a lot of document.write, heavy DOM manipulation or very strict assumptions about which script runs first, this can trigger extra layouts or even loops that make the page feel “frozen”.
– Use the browser Performance profiler to see whether the 20–50 seconds are really spent in RUM functions or in your own/third-party scripts that behave differently once RUM is present.
– For very sensitive pages, you can exclude them from automatic injection or switch to manual RUM injection and place the snippet in a safer position.
In your case, the best next step might be to ask Dynatrace Support (or the consultants who already resolved these issues for you) to walk you through exactly what they changed and what the root cause was. They can explain which part of the setup was responsible for the slowdown and how they fixed it, so you’ll know what to look out for in the future.
here usefull links:
Set up agentless Real User Monitoring
Configure automatic injection
18 Nov 2025 09:22 AM
Hi @t_pawlak ,
Thanks a lot for the elaborate explanation! I will have a deeper look in the two scenarious that you described and discuss them with the consultants.
In this particular case it seems to be a CSP violation, so we will investigate in this direction. Most probably something changed on the application side which lead to this degraded performance with the Dynatrace injection.
Thanks again!
All the best,
Georgi