Troubleshoot New Relic
Find troubleshooting solutions for your New Relic account.
This section provides solutions for common New Relic troubleshooting scenarios.
Common Access Problems
New Relic Dashboard says "You do not have permission to view this account"
-
Select the User Account in the New Relic Dashboard.
-
Select Log Out from the drop-down menu.
-
Go to the Site Dashboard and click the Go to New Relic button.
If You Click the Go to New Relic Button and Are Instead Sent to a Log in Screen
Log into the Pantheon Dashboard in an Incognito or Private window. The New Relic accounts are shared via SSO, so loading the page in a private window will force new sign-in credentials. If you can sign in this way, use the steps below to resolve access for your main browser session.
-
Close all of your open New Relic tabs.
-
Delete all of the New Relic cookies from your browser (support articles for Chrome or Firefox).
-
Reload your Pantheon Dashboard.
-
Click the Go to New Relic button.
If You Are Prompted to Set Up New Relic
You will be prompted to set up New Relic if you try to access New Relic before any traffic reaches an environment.
-
Visit one of your site pages.
-
Close the tab and wait a few minutes.
-
Click the Go to New Relic button.
If you see "We're sorry, you haven't verified your email address yet."
A confirmation email is sent to the site owner to complete the setup process after activating New Relic; Performance Monitoring. The account must be verified before members of the site can access the New Relic dashboard.
If the New Relic account holder (the site owner or user who activated the New Relic® account for the site) did not receive the confirmation email, you can re-send the link by clicking Forgot your password:
-
Click Forgot your password? on New Relic's login page.
-
Enter the email address of the site owner.
-
Click Send my reset link.
-
Open the email and click the reset link.
-
Follow the prompts to access your account.
Contact support if you are unsure what user the New Relic account is associated with and are unable to identify where the password reset email has been sent.
Remove Multidev Environments in New Relic
You must manually remove a deleted Multidev environment in New Relic after you delete the Multidev from your Pantheon site.
-
Go to the Site Dashboard, select the New Relic tab, and click Open New Relic to see APM & Services.
-
Select the specific APM (application) you want to remove from the APM list, then click the Application tab in the left menu.
-
Navigate to the bottom of the page, click the Delete application button, then click the Confirmation button when prompted.
Enable Browser Monitoring for Drupal 10.2+
If you are running Drupal 10.2 or higher, New Relic’s Browser Agent auto-instrumentation is disabled by default.
WordPress sites and older versions of Drupal (pre-10.2) do not enforce this header strictly. Auto-instrumentation of New Relic’s Browser agent continues to work out-of-the-box for those frameworks.
The Context: Why is Auto-Instrumentation disabled?
Starting in version 10.2, Drupal automatically calculates and sets a Content-Length HTTP header for most page responses to optimize web server performance.
Normally, New Relic’s server-side PHP Agent acts as a middleman, automatically injecting the Browser Agent into your HTML before it reaches the user. However, this injection increases the total size of the file. This creates a mismatch between the originally declared Content-Length and the new, larger payload size. This mismatch can cause modern browsers to truncate (cut off) the page before it fully loads, breaking your site's layout and functionality.
In order to avoid this, we automatically disable the Browser auto-injection feature for sites using Drupal 10.2+. This is in line with New Relic’s official documentation, and your PHP agent instrumentation remains unchanged.
Instead, one option provided by New Relic is to manually instrument your site by pasting the Browser Agent snippets directly into your page templates. This should restore the previous metrics collection, but can be a tedious process.
Another option is to enable Pantheon’s automatic Browser Agent injection, which will automatically add the Browser Agent headers and footers on demand via PHP prepend files behind the scenes. Because removing this header can negatively impact edge caching and how browsers download your site's assets, we do not strip this header or auto-inject the script by default for Drupal 10.2+ environments.
How to Enable Browser Monitoring
You have two options to enable the New Relic Browser Agent. You must only choose one. Using both methods simultaneously will result in double-counted metrics and skewed performance data.
-
If you have previously implemented Option 1 (manual instrumentation), you must not use Option 2 (Pantheon's auto-inject) as it may result in incorrect recording of Browser metrics. Instead, leave
browser_auto_injectset tofalse(or omit it entirely) within your site'spantheon.ymlconfiguration file. -
If you choose Option 2 (Pantheon's auto-inject), be aware that stripping the
Content-Lengthheader modifies core Drupal HTTP behavior. While generally safe, if you utilize highly customized edge caching rules that strictly rely on this header, you may experience unexpected caching behavior. If this occurs, revert to Option 1.
Option 1: Manual Theme Instrumentation (Recommended)
This is New Relic’s officially recommended workaround. By manually placing the JavaScript snippet into your theme, you avoid header conflicts entirely.
- Log into your New Relic dashboard.
- Click Browser from the lefthand navigation menu.
- Select Add your first browser app then click Browser monitoring.
- Click Place a JavaScript snippet in frontend code, then enter a name for your browser app and click Save and continue.
- Based on your site requirements, determine whether to enable distributed tracing for this browser app.
- Copy the provided code snippet from New Relic and paste it directly into your Drupal theme's header file (typically
html.html.twig), placing it as high up in the<head>tag as possible. - Commit and deploy your code.
Option 2: Platform Auto-Injection via pantheon.yml
If you prefer not to edit your theme files, you can instruct our platform to forcefully handle the injection for you using PHP prepend files and the output buffer. Enabling this setting tells our high-level prepend logic to grab the output buffer, strip the Content-Length header, and safely inject the Browser Agent script via the PHP agent according to New Relic standards.
-
Open your project's code repository.
-
Locate the
pantheon.ymlfile in the root directory. -
Find or add the
new_relic:key, and addbrowser_auto_inject: true. For example: -
Commit and push the
pantheon.ymlfile to your environment. -
Changes will take effect within 5 minutes and you should see data populating in the Browser section in your site’s New Relic.
Before touching the output buffer, or injecting the Browser Agent snippet, we run several checks (in the following order) to ensure we are only instrumenting in the correct cases. Auto-injection will not occur unless all of the following are true:
- PHP interface (
php_sapi_name()) is not cli - PHP has the
newrelicextension loaded - Site has Browser Auto-Inject enabled (
browser_auto_inject: true) inpantheon.yml - Request is not from a Pantheon healthcheck (
REQUEST_URIof "/healthz") - Request is for HTML content (
HTTP_ACCEPTof 'text/html')
Disable New Relic Browser Monitoring Agent
You might encounter situations where New Relic's Browser agent interferes with other systems. For example, the JavaScript tag might cause Google AMP validator failures, such as The tag 'script' is disallowed except in specific forms. You can resolve many errors by disabling New Relic's browser monitoring agent.
New Relic is disabled on all AMP pages in this example:
The code above should be added to settings.php for Drupal sites or wp-config.php for WordPress sites.
To isolate the disabling of New Relic to only AMP pages, the example logic checks the current request for ?amp. Adjust this example as needed based on your site's implementation of Google AMP and it's corresponding URL patterns.
It is important to note that this method is sensitive to call location. Most customers find success calling this method early in a transaction. For Drupal, this can be done using an event subscriber that listens to the kernel.request event, for instance.
APM Availability Monitoring
Availability monitoring from APM is heavily outdated, and will not work with the Pantheon platform. You can use the free New Relic Synthetic Lite service as an alternative. Refer to Configure Ping Monitors for Availability for more information.