Account created on 14 April 2014, about 10 years ago
#

Recent comments

@chris-burge - one of our performance engineers reviewed the code snippets in our staging environment and confirmed that everything looks good! If your MR doesn't get any traction in the next several days, I'll be applying the lastest version of it as a patch to our code base so it can go to production. Thanks for all your work!

@chris-burge - I tested this in my local ddev environment as well as in one of our Acquia environments and so far everything seems to be working as expected. The snippets are rendering in the "correct" place (high up in the <head> tag and pretty low in the <body> tag).

I have also confirmed that browser page view timing, errors and session traces are appearing in New Relic as well. I will try to see if I can get some additional eyes on this as well!

@afireintheattic - I was able to get the NR agent running with ddev using the config files here:
https://github.com/ddev/ddev-contrib/pull/103#issuecomment-1605581669

I know you're running lando (with which I'm not familiar) but perhaps that will help you test locally?

@chris-burge for some reason the library and settings aren't getting attached in our Acquia environment and therefore the footer snippet isn't getting generated/executed. We're going to localize the patch prior to your last commit and use it as a local patch until we determine the issue.

The patch from @pieterdtt was to demonstrate how he get the header snippet moved up into the head tag if you'd like to investigate that as an option.

@chris-burge I know that NR also shows examples with the header snippet inside the body tag instead of inside the head tag, which is contradictory. It does render as the first child element of the body tag currently, though. I'm waiting for some more specific from some of our NR performance experts to see if they recommend a change.

As for the footer, I'm not sure about that either. I've asked our lead developer for some feedback as I know he was able to get the header snippet up in the head tag, perhaps he has ideas for the footer snippet as well.

We are actively using this patch in a production environment. It does seem to work, however, there has been question about the placement of the snippets.

Shouldn't the JS timings header code get inserted into the HEAD tag? Would it make more sense to use something like newrelic_get_browser_timing_header() to move it up as much as possible?

Per the New Relic manual instrumentation documentation:

Insert the return value of newrelic_get_browser_timing_header() as part of the output page's <head> tag, preferably as the very first thing.

Same with the footer:

As the very last thing before the closing </body> tag in the document, or as close to it as possible, insert the return value of newrelic_get_browser_timing_footer().

Production build 0.69.0 2024