newrelic.browser_monitoring.auto_instrument is a very useful feature, except it is missing a setting to load its header and footer scripts through external scripts automatically.
newrelic.browser_monitoring.auto_instrument_url = string. (e.g.
/__newrelic__/ ends up with
/__newrelic__/footer are used for both parts of initialization)
- The script inserted by NewRelic is incompatible with Cypress, which, because it is an inline script, very hard to avoid. If it was external scripts, you could simply route the given setting to an empty file from the cypress tests and avoid errors caused by incompatibilities of Cypress’s monkey-patched XMLHttpRequest object and NewRelic’s instrumentation code.
- Manual instrumentation is significantly more annoying to do when your web application does not necessarily have shared controller logic on each page (which is why automatic instrumentation is wanted).
- It is less than ideal to have to manually disable auto instrumentation for NewRelic by needing to watch for magic flags in the URL, especially with non-uniform view controllers.
I get that you want to have “best performance” of your page instrumentation by inlining the code, but it fails to be a “small script”, and worse, makes headaches when trying to run tests against production. Give us the option to load the inline scripts as external scripts (both insertion into the page for header/footer handled by automatic instrumentation and output of the specified url controlled by your extension). You can feel free to note that this might cause metrics to become skewed, but you’re already skewing metrics with the amount of code you already insert instead of sending a max-age=86400 cache controlled external script instead.
Literally can make all my headaches go away with your extension if I could just webRequest block your code away for my tests.
New Relic Edit
- I want this too
- I have more info to share (reply below)
- I have a solution for this
We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.