For each Drupal website that you want to monitor with New Relic, complete the following steps, depending on if you are using Cloud Platform or Site Factory:
Cloud Platform
Add the following code to the end of the website’s settings.php file:
if (extension_loaded('newrelic')) {
$exploded_path = explode('/', dirname(__FILE__));
$site_domain = array_pop($exploded_path);
newrelic_set_appname("$site_domain;CURRENT_APP_NAME", '', 'true');
}
Site Factory
For a post-settings.php hook script to use with your websites, see Altering values in settings.php with hooks.
The $site_domain variable is assigned the name of the folder for this particular settings.php file. This appears in your list of applications on New Relic’s website. To find this list, go to New Relic.
The newrelic_set_appname() function uses the following three parameters:
CURRENT_APP_NAME with whatever the New Relic App name currently is. You can find this in New Relic under Settings > Environment > Agent initialization. Look for newrelic.appname. It needs to be exactly the same, or New Relic will create a new application and the trace history will be broken.The app name displayed in New Relic can be different from the actual New Relic app name, since it is possible to manually change the displayed name in the New Relic interface.true, New Relic will keep the trace collected so far. This has a slight performance impact.For additional documentation regarding New Relic, see their documentation website.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
For each Drupal website that you want to monitor with New Relic, complete the following steps, depending on if you are using Cloud Platform or Site Factory:
Cloud Platform
Add the following code to the end of the website’s settings.php file:
if (extension_loaded('newrelic')) {
$exploded_path = explode('/', dirname(__FILE__));
$site_domain = array_pop($exploded_path);
newrelic_set_appname("$site_domain;CURRENT_APP_NAME", '', 'true');
}
Site Factory
For a post-settings.php hook script to use with your websites, see Altering values in settings.php with hooks.
The $site_domain variable is assigned the name of the folder for this particular settings.php file. This appears in your list of applications on New Relic’s website. To find this list, go to New Relic.
The newrelic_set_appname() function uses the following three parameters:
CURRENT_APP_NAME with whatever the New Relic App name currently is. You can find this in New Relic under Settings > Environment > Agent initialization. Look for newrelic.appname. It needs to be exactly the same, or New Relic will create a new application and the trace history will be broken.The app name displayed in New Relic can be different from the actual New Relic app name, since it is possible to manually change the displayed name in the New Relic interface.true, New Relic will keep the trace collected so far. This has a slight performance impact.For additional documentation regarding New Relic, see their documentation website.
If this content did not answer your questions, try searching or contacting our support team for further assistance.