The New Relic Infrastructure agent can be configured in a variety of ways. The default method is to edit the configuration variables in the
A configuration file template is available in Infrastructure config file template. You can also override the config file by setting environment variables, or use config management tools, such as Ansible or Puppet.
To configure Infrastructure integrations, see the specific integration's documentation.
For more information, check out New Relic University’s tutorial Creating and viewing custom attributes in Infrastructure, or the full online course Getting started with Infrastructure.
Configuration methods and precedence
The default method to configure the Infrastructure agent is the
newrelic-infra.yml config file. You can override the config file by setting environment variables, which is ideal for containerized environments.
Here are detailed descriptions of each configuration method:
- Configuration file (
newrelic-infra.yml) location and description
To configure the Infrastructure agent, use the
newrelic-infra.ymlfile. Its default location is:
C:\Program Files\New Relic\newrelic-infra\newrelic-infra.yml
For a sample config file, see our Infrastructure config file template.
- Environment variable syntax and description
To set an environment variable, use the variable name from the config file in all caps and prefix with
NRIA_; for example,
NRIA_LICENSE_KEY. Only use environment variables with containerized environments.
The options described in the Infrastructure config file template include their corresponding environment variables, labeled as
Env var. Environment variables are also listed in Infrastructure configuration settings.
- Using environment variable passthroughs with on-host integrations
You can use environment variables to control config settings for on-host integrations, which can then be passed through to the Infrastructure agent. Variables that can be used with each on-host integration are listed in the documentation for each integration, and can be set through one of the following methods.
From inside the config file: add an entry to the Infrastructure config file to allow the agent to get the environment variables you've set.
passthrough_environment: - HTTPS_PROXY - HTTP_PROXY
From the command line: use another environment variable to pass through these settings.
For a better understanding of configuration settings, see Infrastructure configuration settings, which contains a detailed explanation of each variable.
Configuration file structure
newrelic-infra.yml, you must conform to the YAML format and adhere to the following rules:
- Do not modify the casing of the configuration options: YAML keys are case sensitive.
- Respect the indentation levels. All indentations are in similar increments, typically of two space characters. Data in the same stanza of the file must use the same level of indentation. Indent any sub-stanzas by an additional two spaces (see examples in Custom attributes and Network interface filters).
A template of
newrelic-infra.yml is available in Infrastructure config file template. Use a validator to ensure the syntax is accurate before using the file with New Relic's Infrastructure agent
Always restart the agent or your web server after changing settings.
Configuration management tools
To dynamically create your configuration file and manage the Infrastructure agent with configuration management tools, see the Infrastructure documentation for: