Find the agent root directory

The agent root directory is the main folder that holds the files for the agent you installed. Typically, the agent root directory is the directory where the New Relic agent installs the configuration file.

You may need to find the agent root directory for several reasons:

These strategies to help you find the root directory are applicable if you followed the default installation procedures. If you installed to a different directory, this information might not apply.

APM agents

The agent root directory depends on the agent you are using:

Go agent

The Go agent root directory is the root directory of your app, where you imported the go-agent package when you installed the Go agent.

Java agent

The Java agent root directory is called newrelic, which you created in your app server's root directory when you installed the Java agent.

.NET Core 2.0 agent

The location of the .NET Core 2.0 agent root directory depends on your system:

System Location of the agent root directory
Windows

Look in the CORECLR_NEWRELIC_HOME environment variable for your application to find the location of the agent root directory.

Linux

The location of the agent root directory is /etc.

You can also look in the CORECLR_NEWRELIC_HOME environment variable for your application to find the location of the agent root directory.

Docker In the root directory for your app, look for the agent root directory called NewRelic, which you created when you installed the Core 2.0 agent with Docker.
.NET Framework agent

The location of the .NET Framework agent root directory is C:\Program Files\New Relic\.NET Agent.

Node.js agent

The Node.js agent root directory is the root directory of your app, where you copied newrelic.js when you installed the Node.js agent.

PHP agent
The location of the PHP agent root directory depends on how you installed the agent:
Installation method Root directory location
With a package manager or tar archive

Use phpinfo() and look in the sections called Scan this dir for additional .ini files or Additional .ini files parsed for the location of the newrelic.ini file. This file will be in the agent root directory, which is called newrelic-php5.

The PHP agent root directory is called newrelic-php5 for all supported PHP versions, including PHP 7.

With a configuration system, like Puppet or Chef To find all of the locations where the PHP agent was installed, check the NR_INSTALL_PHPLIST environment variable for a list of agent root directories.
Python agent

You can install the Python agent anywhere on your host system and then supply a path to it through the NEW_RELIC_CONFIG_FILE environment variable or the newrelic.agent.initialize() API call.

To find the location of the agent config file, look in the NEW_RELIC_CONFIG_FILE environment variable or the newrelic.agent.initialize() call for the path to the agent root directory.

Ruby agent

The location of the Ruby agent root directory depends on how you installed the agent:

Installation method Root directory location
With the newrelic_rpm gem

The Ruby agent root directory is in the root directory of your app in a directory called config.

Without the gem

Look in the NEW_RELIC_CONFIG_PATH environment variable for the path to the agent root directory.

If there isn't a path in that environment variable, check the following directories to find the one that contains the newrelic.yml file:

  • config
  • $HOME/.newrelic/
  • $HOME/

Mobile agent

The Mobile agent root directory is the root directory of your app.

Infrastructure agent

The location of the Infrastructure agent root directory depends on your system:

Infrastructure agent
System Root directory location
Windows C:\Program Files\New Relic\newrelic-infra\
Linux, Docker, and Elastic Beanstalk /etc
On-host integrations for the Infrastructure agent
The location of the root directory for on-host integrations is /etc.
Cloud integrations for the Infrastructure agent
Since cloud integrations are not installed but are connected to Infrastructure through your cloud service provider, there is not a root directory specific to cloud integrations.

For more help

Recommendations for learning more: