06 Dec 2021 12:11 AM - last edited on 06 Dec 2021 08:58 AM by MaciejNeumann
Hi, I've been using Dynatrace RUM to monitor my web application. The application is segregated into multiple micro apps which is handled by different teams. It's a serverless application so we are using manual injection.
After a lot of discussion and consideration around the injection method, we decided to use inline code method to keep the web request minimum and we are using it in async mode in JavaScript tag.
But as mentioned in Dynatrace wiki documentation as well, this method as maintenance overhead as we need to update the monitoring code every time we make any changes in Dynatrace settings.
I want to understand if i use JavaScript tag method, does it have any major performance implications. I am using Dynatrace managed, so does it everytime go to the server to fetch the script or is there any caching available?
To be honest, I want to use JavaScript tag because it gives us the flexibility to change the settings at anytime because how do i convince others and my developers because apparently, the JS injection method is creating a bit of performance degradation of the page. That is the reason they decided to go ahead with inline code to keep everything in a single file.
Any suggestions or ideas on how I achieve this in a best way? Appreciate in advance.
Best Regards,
Shashank
06 Dec 2021 05:47 AM
Hello @agrawal_shashan
After a long time, once again I had gone throught the documentation.
Please have a look at the below link for more insight:
Regards,
Babar
06 Dec 2021 12:03 PM
Hi @Babar_Qayyum Thank you for the quick response. I was looking at the Code Snippet option and it has 2 methods - sync and deferred. We obviously don't want to use Sync because it's render blocking and may affect performance.
Now with the deferred (Async) method, is there a recommended way to to use this? I mean where should we put this in our application html? Since it is deferred, will we loose some kind of monitoring visiblity? Also there is a line which says - "Requires regular snippet updates to guarantee compatibility." What does it mean? Do we need to update the html files everytime we change the settings in Dynatrace?
Let me know if you can advice on this please.
06 Dec 2021 12:08 PM - edited 06 Dec 2021 12:09 PM
@Babar_Qayyum The reason I asked this is because I tried to change a setting in Advanced set up (cux=1) and it is now asking me to change the code snippet in application. How do i avoid this everytime i make the changes?
Please see the screenshot attached.
13 Dec 2022 03:56 PM
Hi @Babar_Qayyum!
Are @agrawal_shashan's hints possible to receive some kind of workaround?
Thank you for feedback in advance!
20 Dec 2022 06:55 AM
Hello @agrawal_shashan
Apologies for the late reply. I am not 100% confident about the best practices but I believe they should be placed at the beginning of each HTML page similar to other codes.
Exactly. The code snipped required a manual update every time to adapt to the changes.
Regards,
Babar