---
title: "Configuring New Relic"
date: "2024-02-14T06:18:38+00:00"
summary: "Optimize your New Relic APM configuration on Acquia Cloud Platform with our comprehensive guide. Learn to enhance functionality, troubleshoot issues, and leverage advanced features for improved application performance monitoring."
image:
type: "page"
url: "/acquia-cloud-platform/configuring-new-relic"
id: "683ecf24-b459-4059-a8fc-1ce5750a960d"
---

Table of contents will be added

The following documentation provides instructions on how to configure the New Relic APM Pro account included within an Acquia subscription.

Enhanced functionality using the New Relic contributed module
-------------------------------------------------------------

Acquia recommends you to install the [New Relic contributed](https://www.drupal.org/project/new_relic_rpm) module to take advantage of more New Relic APM features as detailed on the module’s project page.

Important

New Relic is not supported as a [log forwarding](/acquia-cloud-platform/log-forwarding-cloud-platform "Log forwarding in Cloud Platform") destination in Cloud Platform.

Recommended configuration settings
----------------------------------

The recommended setting for `newrelic.loglevel` is `error` rather than `warning`. You must add code to set the `newrelic.loglevel` at the end of your `settings.php` file after the [Acquia require line](/acquia-cloud-platform/manage-apps/code/require-line) as shown in the following example:

    if (file_exists('/var/www/site-php')) {
       require('/var/www/site-php/<site>/<site>-settings.inc');
    }
    
    ini_set('newrelic.loglevel', 'error');
    

Setting `newrelic.loglevel` to `warning` can result in too many messages which can fill up the `/mnt` directory and cause PHP errors.

### Using New Relic Synthetics Lite to Monitor Uptime

Organization owners can use the [included](/acquia-cloud-platform/monitor-apps/apm) Synthetics Lite subscription to monitor the uptime of their application with Ping Monitors. For detailed instructions on setting up Ping Monitors, see [Add and edit monitors](https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/add-edit-monitors/).

### Disabling New Relic performance monitoring for an environment

To disable a New Relic APM license key to a Cloud Platform environment:

1.  [Sign in to the Cloud Platform user interface](/node/55875) as a user with permission to change the environment’s settings.
2.  Click the name of the application containing the environments for which you want to disable New Relic monitoring.
3.  Click your desired environment, and then click the **Configure** icon.
4.  On the **Configuration** page, click **Performance monitoring (New Relic)**.
5.  In the **Provider** drop-down list, select **Disabled**.

### Troubleshooting

If your New Relic account is not actively showing performance monitoring data, even after accessing one or more sites on your environments, follow the steps outlined in the [Adding a New Relic license key to a Cloud Platform environment](/acquia-cloud-platform/monitor-apps/apm#cloud-add-new-relic-license-key) section. You must complete the steps to confirm your New Relic License Key is installed.

Note

Using shared infrastructure for your non-production environments can skew provided performance data due to activity by other websites on the shared infrastructure during periods of high activity.

To remove the New Relic code from your website because of a conflict with JavaScript included in your codebase, view the following documentation:

*   [Disable Browser agent](https://docs.newrelic.com/docs/browser/new-relic-browser/installation/disable-browser-monitoring#disable-agent)
*   [Disabling New Relic agent injection](/acquia-cloud-platform/monitor-apps/apm/disable-newrelic-injection)

### Additional features

The following features are also available on Cloud Platform:

*   [Multisite installations](#cloud-newrelic-multisite) are supported
*   [Drush and external calls](#cloud-newrelic-drush) can be monitored
*   [Node.js applications](#cloud-newrelic-node-js) can be monitored

New Relic multisite capabilities
--------------------------------

If you’re enabling New Relic performance monitoring for a multisite environment (including Site Factory), review the instructions at [Using New Relic monitoring in a multisite environment](/acquia-cloud-platform/monitor-apps/apm/multisite) to enable per-site reports in New Relic.

Using New Relic to monitor Drush
--------------------------------

You can use New Relic to monitor Drush and its use of external calls by adding the following code snippet to your `drush.ini` file:

    extension=newrelic.so
    newrelic.license = "[INSERT LICENSE KEY HERE]"
    newrelic.appname = "[sitename].[env]"
    newrelic.daemon.port = /run/newrelic.sock
    

where the `[LICENSE_KEY]` is your New Relic key, and `[sitename].[env]` is the environment that you want to monitor.

Installing the New Relic Node.js agent
--------------------------------------

To configure New Relic monitoring for your Node.js application:

1.  Run the `npm install newrelic --save` command locally for the application you want to monitor. New Relic libraries are both added to the `node_modules` directory and added as a dependency in the `package.json` file.
2.  From the newly downloaded `node_modules/newrelic` directory, copy `newrelic.js` into the root directory of your application.
3.  At line 12 of `newrelic.js`, replace `My Application` with your application name.
    
    Your New Relic dashboard will display the application name in the list of monitored apps.
    
4.  At line 16, replace `license key here` with your New Relic license key.
5.  Commit the `package.json` and `newrelic.js` files to your repository.
6.  Include the New Relic module in your code by adding `require('newrelic');` as the first line of your app's main module. For more information, see [Install the Node.js agent](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/install-nodejs-agent/).
7.  Trigger a Pipelines job by doing one of the following actions:
    *   Create or reopen a pull request
    *   Push a commit
    *   Push a tag
    *   Use the Cloud Platform user interface
8.  Deploy the build artifact to an environment in Cloud Platform.
9.  Generate traffic and then wait for the data to display in your New Relic APM user interface.

You can extend New Relic application monitoring within your Node.js application by setting up [custom metrics](https://docs.newrelic.com/docs/agents/nodejs-agent/supported-features/nodejs-custom-metrics) and [custom instrumentation](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/extend-your-instrumentation/nodejs-custom-instrumentation).

### Compatibility statement

Cloud Platform is compatible with the Application Monitoring services provided by New Relic. Acquia doesn’t support New Relic Infrastructure Monitoring services, Log Monitoring services, or any plug-ins.

Cloud Platform isn’t compatible with [New Relic APM’s Distributed Tracing](https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/get-started/introduction-distributed-tracing) feature.

Note

Acquia cannot make changes to the New Relic agent on a per-client basis.

Acquia does not support the installation of New Relic on any non-web infrastructure. While New Relic routinely makes updates to their services and periodically adds new features, Acquia will update versions of this service running on Cloud Platform twice annually. This allows Acquia to ensure new logic in New Relic’s PHP monitoring agent has had several months to stabilize before introducing it onto Cloud Platform.

New Relic browser monitoring for Drupal 10.2 or later
-----------------------------------------------------

To use the browser monitoring feature of New Relic in sites that run on Drupal 10.2 or later, Acquia recommends you to install the [New Relic contributed](https://www.drupal.org/project/new_relic_rpm "https://www.drupal.org/project/new_relic_rpm") module patched with [MR!5](https://git.drupalcode.org/project/new_relic_rpm/-/merge_requests/5 "https://git.drupalcode.org/project/new_relic_rpm/-/merge_requests/5") from the [Allow for RUM Manual Instrumentation](https://www.drupal.org/project/new_relic_rpm/issues/3444218 "https://www.drupal.org/project/new_relic_rpm/issues/3444218") issue.