Skip to content

How-to Guides

Technical References

Tools for Site Management /

New Relic

New Relic is available for clients running on our VIP Go platform. New Relic is an application monitoring platform and on VIP Go, you can use it to monitor the PHP (WordPress) code and browser performance of your site or application.

If your team would like to use New Relic, please contact us and we’ll be happy to arrange access for you. We do not charge for access to New Relic.

The New Relic plan we run is as follows:

  • Web Pro Annual — this is the PHP application monitoring that covers your WordPress application code
  • Mobile Lite
  • Insights Free
  • Browser Lite
  • Synthetics Lite

The differentiation mainly affects the retention of monitoring data, with Pro elements retaining data for longer than Lite elements.

New Relic installation on VIP infrastructure

New Relic is installed and activated on a maximum of 50% of web containers per WordPress environment. Typically, a non-production environment will run just two web containers (and will therefore have one New Relic instance), and the majority of our production environments run fewer than 15 web containers. The maximum number of New Relic instances per environment is 15.

By default, the New Relic agent is not activated on CLI containers for WordPress environments; these are the containers that run WP-CLI commands and also run WordPress Cron events. If it is important to monitor the performance of your Cron events and WP-CLI commands, please get in touch and we can activate the New Relic activation on the CLI containers for any of your environments.

The New Relic agent is not installed on any other parts of our infrastructure (i.e., the VIP CDN or database containers).

Number of users

You can have as many New Relic users as you require. Please contact us with the email addresses of any team members who need access to your New Relic monitoring.

The VIP team uses New Relic to monitor all the sites and applications on the VIP Go platform; therefore we require that your application uses the WordPress.com VIP New Relic account, rather than your own New Relic account, in order for us to continue doing so.

Note

It is your responsibility to request that leaving members of your teams have their New Relic access removed.

Enabling New Relic Browser Monitoring

If your WordPress application was created before August 12, 2020, you have New Relic Browser Monitoring enabled by default.

To disable Browser Monitoring, you can use the newrelic_disable_autorum() function:

if ( function_exists( 'newrelic_disable_autorum' ) ) {
    newrelic_disable_autorum();
}

If your application was created on or after August 12, 2020, Browser Monitoring is disabled by default. To re-enable, remove the newrelic_disable_autorum() function call in your vip-config.php file.

New Relic PHP API and SDK

New Relic maintains a suite of PHP functions which can be used to add data to transactions, name transactions, etc. You can read more in their documentation. WordPress.com VIP uses this API to enhance the data provided by all VIP Go WordPress applications (see the code).

We don’t offer custom PHP INI configuration for individual WordPress applications (sites), but you may find that some of the configuration can be set in PHP at runtime using ini_set().

Separating apps out on a per-site basis for multisite

For a site-per-app basis, you can use newrelic_set_appname() in vip-config.php or client-mu-plugins:

if ( extension_loaded( 'newrelic' ) && defined( 'VIP_GO_ENV' ) && 'production' === VIP_GO_ENV ) {
	newrelic_set_appname( $_SERVER['HTTP_HOST'] );
}

Depending on how your multisite structure is set up, you may need to set the application name accordingly (e.g. to account for paths in the application name if the sites share the same host domain). For example, if site 2 is https://example.com/foo and site 3 is https://example.com/bar), you’d want to distinguish between them:

add_action( 'init', 'my_new_relic_appname', -1 );
/**
 * Set application name for New Relic.
 *
 * This is because we want to keep the main site appname the same as before so all data/reports are in the same place.
 *
 * Ensure PHP agent is available and only when not the main site. 
 */
function my_new_relic_appname() {
	if ( extension_loaded( 'newrelic' ) &&
		defined( 'VIP_GO_ENV' ) &&
		'production' === VIP_GO_ENV &&
		! is_main_site()
	) {
		$parsed_site_url = wp_parse_url( site_url() );
		$path            = $parsed_site_url['path'] ?? '';
		newrelic_set_appname( $_SERVER['HTTP_HOST'] . $path );
	}
}

Further reading

For further information about New Relic, we recommend exploring their documentation:

General New Relic documentation

Some specific picks from the New Relic documentation which might be of particular interest:

Last updated: November 12, 2020