---
title: "Using New Relic monitoring per site in MEO"
date: "2026-08-10T00:48:34+00:00"
summary: "Split New Relic APM reporting per site in MEO multisites. Learn how to configure settings.php for per-site performance monitoring."
image:
type: "article"
url: "/acquia-cloud-platform/add-ons/multi-experience-operations/help/99001-using-new-relic-monitoring-site-meo"
id: "183d6ff5-dd7c-4055-885f-4f74a9bcfba7"
---

New Relic Application Performance Monitoring (APM) is available in Multi-Experience Operations (MEO) environments. By default, New Relic reports all site traffic under a single application name for each environment. If you run multiple sites in an MEO multisite configuration, you can split New Relic reporting so that each site reports under its own application name in your New Relic account. This is useful when you want to identify performance issues on a specific site rather than diagnosing across a combined aggregate view.

Prerequisites
-------------

*   Enable New Relic APM on the relevant MEO environment. To enable APM, navigate to the **Configuration** sidebar in the Cloud Platform UI.
*   Obtain access to the `settings.php` file for the application, for example, `docroot/sites/default/settings.php`.
*   Identify the current New Relic application name for the environment. To find the name in New Relic, navigate to **Settings > Environment > Agent initialization**, and find the `newrelic.appname` value.

Steps
-----

1.  Open your application's `settings.php` file.
2.  Add the following code to `settings.php`, replacing `<CURRENT_APP_NAME>` with your environment's actual New Relic application name:
    
        if (extension_loaded('newrelic')) {
          $env = isset($_ENV['AH_SITE_ENVIRONMENT']) ? $_ENV['AH_SITE_ENVIRONMENT'] : 'local';
          $site_name = isset($_ENV['AH_DRUPAL_SITE_NAME']) ? $_ENV['AH_DRUPAL_SITE_NAME'] : '';
        
          if (!empty($site_name)) {
            newrelic_set_appname("<CURRENT_APP_NAME>.$env.$site_name;<CURRENT_APP_NAME>.$env", '', 'true');
          }
        }
    
    The variables in this code block function as follows:
    
    *   `$_ENV['AH_SITE_ENVIRONMENT']`: Contains the environment name, such as prod, stage, or dev, set by Acquia. The variable falls back to `local` when not running on Acquia infrastructure.
    *   `$_ENV['AH_DRUPAL_SITE_NAME']`: Contains the Drupal site name for the current site in the MEO multisite configuration. The Acquia environment sets this value.
    
    The `newrelic_set_appname()` function accepts three parameters:
    
    *   **App name(s):** A semicolon-separated list of up to three application names. The first name, for example, `myapp.prod.site1`, is the per-site identifier and serves as the unique key. The second name, for example, `myapp.prod`, is the catch-all that continues to provide an aggregate view of all sites on the environment. Replace `<CURRENT_APP_NAME>` with the exact value of `newrelic.appname` found in New Relic. The name displayed in the New Relic UI can differ from the internal app name value; use the internal value.
    *   **New Relic subscription key:** Leave blank (`''`) to use the global key already configured for your environment.
    *   **xmit identifier:** When set to `'true'`, New Relic retains any transaction data collected before the app name was changed. Retaining transaction data introduces minor performance overhead.
3.  Save the changes to `settings.php` and deploy the file to your MEO environment.
4.  In your New Relic account, verify that per-site application names are now reporting data separately from the catch-all application name.

Limitations
-----------

Because PHP processes the `settings.php` file during PHP bootstrap before Drupal fully initializes, the New Relic PHP agent bootstraps against the primary catch-all application name. Therefore:

*   Drupal-specific monitoring data such as module timings, view render times, and hook data, is available only on the catch-all application name and not on per-site application names.
*   Per-site application names receive all other APM data, including transaction traces, error rates, and throughput.

Related resources
-----------------

*   [Using New Relic monitoring in a multisite environment](https://docs.acquia.com/acquia-cloud-platform/using-new-relic-monitoring-multisite-environment): Cloud Platform and Site Factory guidance
*   [Configuring your MEO environment](https://docs.acquia.com/acquia-cloud-platform/add-ons/multi-experience-operations/configuring-environment): how to enable New Relic APM in the Acquia Cloud Next UI
*   [New Relic PHP agent API: newrelic\_set\_appname](https://docs.newrelic.com/docs/apm/agents/php-agent/php-agent-api/newrelic_set_appname/): official New Relic documentation