Loading...


Related Products


Date Published: June 10, 2024

New Relic Browser Monitoring not working under Drupal 10.2+

Issue

Due to the change in Drupal 10.2 which introduces the Content-Length header on Drupal responses , the New Relic automatic injection of the Browser-side tracking Javascript code becomes disabled whenever that header is present. Thus, if your application depends on this information, actions must be taken to resolve.

This issue only impacts sites that need the Browser Monitoring in New Relic (which includes metrics like browser-side timing of rendering, networking, page views, etc). The APM (Application Performance Monitoring) feature which tracks the performance of Drupal/PHP and dependencies like MySQL, Memcache and external requests is unaffected

Resolution

New Relic's automatic insertion of this code is incompatible with the Content-Length header . New Relic recommends manual instrumentation in these instances, meaning that the Javascript should now be inserted by the web application instead of the New Relic agent.

As of June 2024, Acquia is working on a robust solution. For now, customers can implement one of the workarounds below:

Option 1) Use a patched version of the New Relic Drupal module

Acquia is working with the Drupal open-source community to add the needed feature to the New Relic contrib module, which is hosted and maintained on Drupal.org. We have opened a merge request to add manual instrumentation, and our goal is for it to be merged and released by the module's maintainers.

In the meantime, you can choose to install the module patched with the merge request code, which should insert the needed JS into all Drupal-generated responses.

If you need guidance on how to do this with Composer, see the
Drupal.org documentation on Applying a patch in a feature branch . 

Ensure you clear all caches (including Varnish) after doing this.

Option 2) Write a custom module to insert the New Relic Javascript code

If you are familiar with writing custom modules, you can insert the code via a custom module. For guidance, consult the above-cited merge request.

Option 3) Wait or do nothing

If you do not really need the Browser-side data collection, or want to wait for a final version of the New Relic contributed module (instead of patching), you can choose to do so.

In any event, we recommend you follow the issue on 
Drupal.org: https://www.drupal.org/project/new_relic_rpm/issues/3444218

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation