02 Jan 2025 12:38 PM
1. What is the difference between using NPM package or the JSDelivr CDN for RUM script? What is the advantages and disadvantages of each method?
2. Is there a way to migrate the configuration from one frontend application to another, specially the properties?
3. Is there a way to prevent XHR for capturing data when the RUM script starts, and only do that once the application if fully loaded, when the screen visible to the user?
Solved! Go to Solution.
06 Jan 2025 10:21 AM
@jitendra11
2) Yes, by using configuration as code tools such as monaco or by using the Configuration API and/or settings API manually - depending on which part of the settings are you dealing with. I do recommend to get familiar with monaco tool to manage it, but you can do that manually too - or integrate that into your tooling.
2) If you want to do that, you can set the web application to opt in mode, this will disable the RUM JavaScript and then you can enable it from your application code by calling dtrum.enable . See https://docs.dynatrace.com/docs/shortlink/api-rum for details.
as for 1) - can you please elaborate more on that?
07 Jan 2025 03:46 PM
JSDelivr is just a CDN for serving the files; no difference exists between the code.
Like Julius stated above, the only option to "delay" the XHR module is by using opt-in mode to delay the entire tag. I do not think that meets your use case, though, and would cause monitoring data quality issues. The XHR module needs to be present and active when the agent loads in order to ensure it can properly wrap around and monitoring XHR content. Delaying it until after the page has loaded would make it impossible to track XHR actions.