---
title: Infrastructure agent configuration settings 
source: https://docs.newrelic.com/docs/infrastructure/infrastructure-agent/configuration/infrastructure-agent-configuration-settings
---

The infrastructure agent has a large set of [configuration settings to fine-tune its behavior](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/configure-infrastructure-agent). Here we:

-   List all the configuration options (in both their YAML and the environment variable names).
-   Explain what the settings do and when to use them.
-   Give the variable type and default value (if any).
-   List the minimum required agent version as applicable.

> #### ⚠️ IMPORTANT
>
> With secrets management, you can configure the agent on-host integrations with infrastructure to use sensitive data (such as passwords) without having to write them as plain text into the integration's configuration file. For more information, see [Secrets management](https://docs.newrelic.com/docs/integrations/host-integrations/installation/secrets-management).

Still without a New Relic account? [Sign up](https://newrelic.com/signup) for free, forever.

## Get started [#requirements]

You'll be able to configure our infrastructure agent to suit your environnment after you [create a New Relic account](https://newrelic.com/signup) (it's free, forever) and [install the infrastructure agent](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent/).

The [`license_key`](#license-key) is the only required setting.

For an example of how all these variables can be used, see our [sample configuration template in GitHub](https://github.com/newrelic/infrastructure-agent/blob/master/assets/examples/infrastructure/newrelic-infra-template.yml.example).

## Environment variables

Many of the configuration options listed also admit using environment variables to set values, which take precedence over the YAML configuration.

> #### ⚠️ IMPORTANT
>
> Often the infrastructure agent runs as a system service in the host, managed globally (e.g. `systemd` for Linux, Windows Services, `launchd` for macOS, etc). To apply configuration changes with environment variables in this setup,
> these environment variables need to be set and made visible to the isolated context where the infrastructure agent service is running. The way of doing this is platform-dependent,
> check the documentation for your platform's service manager to know how to add environment variables to system services.

## Agent variables [#agent-variables]

**license_key (REQUIRED)**

Specifies the license key for your New Relic account. The agent uses this key to associate your server's metrics with your New Relic account. This setting is created as part of the standard installation process.

| YML option name | Environment variable | Type   | Default | Version |
| --------------- | -------------------- | ------ | ------- | ------- |
| `license_key`   | `NRIA_LICENSE_KEY`   | string |         |         |

Example:

````yml
license_key: 1234567890abcdefghijklmnopqrstuvwxyz1234
```

````

**FedRAMP**

Specifies whether FedRAMP endpoints should be used.

| YML option name | Environment variable | Type    | Default | Version                                                                                                                                                    |
| --------------- | -------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fedramp`       | `NRIA_FEDRAMP`       | boolean | `false` | [1.15.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1150) |

**max_procs**

Specifies the number of logical processors available to the agent. Increasing this value helps to distribute the load between different cores.

If set to `-1`, the agent will try to read the environment variable `GOMAXPROCS`. If this variable is not set, the default value will be the total number of cores available in the host.

| YML option name | Environment variable | Type    | Default | Version                                                                                                                                                        |
| --------------- | -------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `max_procs`     | `NRIA_MAX_PROCS`     | integer | `1`     | [1.0.1002](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-101002) |

**payload_compression_level**

Since version [1.0.804](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10804) or higher, data sent from the agent is compressed by default. To disable payload compression, set `payload_compression_level` to 0.

> #### ⚠️ IMPORTANT
>
> Recommendation: Do not change this setting.

| YML option name             | Environment variable             | Type    | Default | Version                                                                                                                                                      |
| --------------------------- | -------------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `payload_compression_level` | `NRIA_PAYLOAD_COMPRESSION_LEVEL` | integer | `6`     | [1.0.804](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10804) |

**startup_connection_retries**

Number of times the agent will retry the request to check New Relic's platform availability at startup before throwing an error.

If set to a **negative value**, the agent will keep checking the connection until it succeeds.

| YML option name              | Environment variable              | Type    | Default | Version |
| ---------------------------- | --------------------------------- | ------- | ------- | ------- |
| `startup_connection_retries` | `NRIA_STARTUP_CONNECTION_RETRIES` | integer | `6`     | 1.0.936 |

**startup_connection_retry_time**

After a request has timed out, time the agent waits to retry a request to check New Relic's platform availability at startup.

| YML option name                 | Environment variable                 | Type   | Default | Version          |
| ------------------------------- | ------------------------------------ | ------ | ------- | ---------------- |
| `startup_connection_retry_time` | `NRIA_STARTUP_CONNECTION_RETRY_TIME` | string | `5s`    | 1.0.936 - 1.2.30 |

**startup_connection_timeout**

Time the agent waits until a request to check New Relic's platform availability at startup is considered timed out.

| YML option name              | Environment variable              | Type   | Default | Version |
| ---------------------------- | --------------------------------- | ------ | ------- | ------- |
| `startup_connection_timeout` | `NRIA_STARTUP_CONNECTION_TIMEOUT` | string | `10s`   | 1.0.936 |

**self_instrumentation**

Enables [agent's self instrumentation](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/manage-your-agent/infrastructure-agent-self-instrumentation).

| YML option name        | Environment variable        | Type   | Default | Version                                                                                                                                                    |
| ---------------------- | --------------------------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `self_instrumentation` | `NRIA_SELF_INSTRUMENTATION` | string | `empty` | [1.24.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1240) |

**logging_retry_limit**

Enables [Agent Retry for Log Transmission](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/manage-your-agent/infrastructure-agent-behavior/#retry) via the embedded fluentbit logging forwarder. Integer values are for the number of intended retries. Other possible values include `False` to set the number of retries to infinite and `no_retries` to turn off the retry functionality entirely.

| YML option name       | Environment variable       | Type    | Default | Version                                                                                                                                                    |
| --------------------- | -------------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `logging_retry_limit` | `NRIA_LOGGING_RETRY_LIMIT` | integer | `5`     | [1.29.1](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1291) |

**logging_http_client_timeout**

Sets the HTTP client timeout (in seconds) for the New Relic fluent-bit output plugin. This controls how long the logging forwarder will wait for a response when sending log data to New Relic.

For more information, see the [fluent-bit output plugin documentation](https://github.com/newrelic/newrelic-fluent-bit-output#httpclienttimeout).

| YML option name               | Environment variable               | Type   | Default | Version                                                                                                                                                    |
| ----------------------------- | ---------------------------------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `logging_http_client_timeout` | `NRIA_LOGGING_HTTP_CLIENT_TIMEOUT` | string | `"5"`   | [1.72.1](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1721) |

## Cloud variables

If the agent is running in a cloud instance, the agent will try to detect the cloud type and fetch basic [metadata](https://docs.newrelic.com/docs/integrations/new-relic-integrations/getting-started/understand-use-data-infrastructure-integrations#overview).
Metrics can also be enriched with extended cloud metadata (including custom resource tags) when [connecting the cloud provider](https://docs.newrelic.com/docs/infrastructure/infrastructure-integrations/get-started/introduction-infrastructure-integrations#cloud) account with New Relic.

**cloud_max_retry_count**

Sets the number of times the agent retries to connect in case that cloud detection fails.

If cloud detection fails during the initialization of the agent, the agent will retry after waiting for [`CloudRetryBackOffSec` seconds](#cloud-retry-backoff-sec).

| YML option name         | Environment variable         | Type    | Default | Version |
| ----------------------- | ---------------------------- | ------- | ------- | ------- |
| `cloud_max_retry_count` | `NRIA_CLOUD_MAX_RETRY_COUNT` | integer | `10`    | 1.2.6   |

**cloud_metadata_expiry_sec**

Sets the interval of time the agent will wait until discarding the metadata, in seconds. After this period metadata expires and the agent will fetch it again.

| YML option name             | Environment variable             | Type    | Default | Version |
| --------------------------- | -------------------------------- | ------- | ------- | ------- |
| `cloud_metadata_expiry_sec` | `NRIA_CLOUD_METADATA_EXPIRY_SEC` | integer | `300`   | 1.2.6   |

**cloud_retry_backoff_sec**

Sets the interval of time the agent waits between cloud detection retries in case that cloud detection failed, in seconds.

If cloud detection fails during the initialization of the agent, it will retry for [`CloudMaxRetryCount` times](#cloud-max-retry-count).

| YML option name           | Environment variable           | Type    | Default | Version |
| ------------------------- | ------------------------------ | ------- | ------- | ------- |
| `cloud_retry_backoff_sec` | `NRIA_CLOUD_RETRY_BACKOFF_SEC` | integer | `60`    | 1.2.6   |

**cloud_provider**

Specifies the cloud provider the agent is running in. When this is set up to a value different from the default, the agent will wait until it successfully acquires metadata (the instance ID) from the cloud provider before submitting any data to the backend.

With the default behavior, the agent will also try to detect the cloud provider and get the metadata but without blocking the agent.

Allowed values: `""`, `"aws"`, `"azure"`, `"gcp"`, `"alibaba"`

| YML option name  | Environment variable  | Type   | Default | Version |
| ---------------- | --------------------- | ------ | ------- | ------- |
| `cloud_provider` | `NRIA_CLOUD_PROVIDER` | string | `""`    | 1.40.1  |

**disable_cloud_instance_id**

Similar to [`DisableCloudMetadata`](#disable-cloud-metadata), but it disables the collection of cloud metadata only for the host alias plugin.

| YML option name             | Environment variable             | Type    | Default | Version |
| --------------------------- | -------------------------------- | ------- | ------- | ------- |
| `disable_cloud_instance_id` | `NRIA_DISABLE_CLOUD_INSTANCE_ID` | boolean | `false` | 1.0.220 |

**disable_cloud_metadata**

Disables the collection of cloud metadata.

| YML option name          | Environment variable          | Type    | Default | Version                                                                                                                                                      |
| ------------------------ | ----------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `disable_cloud_metadata` | `NRIA_DISABLE_CLOUD_METADATA` | boolean | `false` | [1.0.690](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10690) |

## Docker variables

**container_cache_metadata_limit**

Time, in seconds, before the cached containers metadata expires and the agent needs to fetch them again.

| YML option name                  | Environment variable                  | Type    | Default | Version |
| -------------------------------- | ------------------------------------- | ------- | ------- | ------- |
| `container_cache_metadata_limit` | `NRIA_CONTAINER_CACHE_METADATA_LIMIT` | integer | `60`    | 1.0.801 |

**docker_api_version**

Specifies the Docker client API version.

| YML option name      | Environment variable      | Type   | Default | Version                                                                                                                                                  |
| -------------------- | ------------------------- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `docker_api_version` | `NRIA_DOCKER_API_VERSION` | string | `1.24`  | [1.1.4](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-114) |

## File system variables [#filesystem-variables]

**custom_supported_file_systems**

List of the types of file systems that the agent supports. This value needs to be a subset of the default list, and items that are not in the default list will be discarded.

| YML option name                 | Environment variable                | Type      | Default                                                                                                    | Version |
| ------------------------------- | ----------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | ------- |
| `custom_supported_file_systems` | `NRIA_CUSTOM_SUPPORTED_FILESYSTEMS` | \[]string | Linux: `["xfs", "btrfs", "ext", "ext2", "ext3", "ext4", "hfs", "vxfs", "zfs"]` Windows: `["NTFS", "ReFS"]` | 1.0.220 |

**file_devices_ignored**

List of storage devices to be ignored by the agent when gathering `StorageSample` data.

| YML option name        | Environment variable        | Type      | Default | Version |
| ---------------------- | --------------------------- | --------- | ------- | ------- |
| `file_devices_ignored` | `NRIA_FILE_DEVICES_IGNORED` | \[]string |         | 1.0.220 |

Example as a YAML attribute:

````yml
file_devices_ignored:
  - sda1
  - sda2
```

Example as an environment variable:

```ini
FILE_DEVICES_IGNORED="sda1,sda2"
```

````

## Hostname variables

**display_name**

Overrides the auto-generated hostname for reporting. This is useful when you have multiple hosts with the same name, since our infrastructure monitoring uses the hostname as the unique identifier for each host. Keep in mind this value is also used for the loopback address replacement on entity names.

For more information, see our documentation on [how entity name resolution works](https://docs.newrelic.com/docs/integrations/integrations-sdk/file-specifications/integration-executable-file-specifications#h2-loopback-address-replacement-on-entity-names).

| YML option name | Environment variable | Type   | Default | Version |
| --------------- | -------------------- | ------ | ------- | ------- |
| `display_name`  | `NRIA_DISPLAY_NAME`  | string | empty   | 1.0.266 |

Example:

````yml
display_name: teslaOne
```

````

**dns_hostname_resolution**

When `true`, the full hostname is resolved by performing a reverse lookup of the host's address. Otherwise, it will be retrieved with the hostname command on Linux and from the TCP/IP parameters of the registry on Windows.

| YML option name           | Environment variable           | Type    | Default | Version                                                                                                                                                  |
| ------------------------- | ------------------------------ | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dns_hostname_resolution` | `NRIA_DNS_HOSTNAME_RESOLUTION` | boolean | `true`  | [1.2.6](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-125) |

**override_hostname**

When set, this is the value that will be reported for the full hostname; otherwise, the agent will perform the normal lookup behavior.

| YML option name     | Environment variable     | Type   | Default | Version  |
| ------------------- | ------------------------ | ------ | ------- | -------- |
| `override_hostname` | `NRIA_OVERRIDE_HOSTNAME` | string |         | 1.0.1015 |

Example:

````
my.custom-hostname.co.org
```

````

**override_hostname_short**

When set, this is the value that will be reported for the hostname; otherwise, the agent will perform the normal lookup behavior.

| YML option name           | Environment variable           | Type   | Default | Version  |
| ------------------------- | ------------------------------ | ------ | ------- | -------- |
| `override_hostname_short` | `NRIA_OVERRIDE_HOSTNAME_SHORT` | string |         | 1.0.1015 |

Example:

````
my.custom-hostname
```

````

## Installation variables [#installation-variables]

**agent_dir**

Directory where the agent stores files for cache, inventory, integrations, etc.

| YML option name | Environment variable | Type   | Default                                                                              | Version |
| --------------- | -------------------- | ------ | ------------------------------------------------------------------------------------ | ------- |
| `agent_dir`     | `NRIA_AGENT_DIR`     | string | Linux: `/var/db/newrelic-infra` Windows: `C:\Program Files\NewRelic\newrelic-infra\` | 1.0.2   |

**plugin_dir**

Directory containing the configuration files of the integrations.

Each integration has its own configuration file, named by default `<integration_name>-config.yml`, placed in a predefined location from which the agent loads on initialization.

| YML option name | Environment variable | Type   | Default                                                                                                      | Version |
| --------------- | -------------------- | ------ | ------------------------------------------------------------------------------------------------------------ | ------- |
| `plugin_dir`    | `NRIA_PLUGIN_DIR`    | string | Linux: `etc/newrelic-infra/integrations.d/` Windows: `\Program Files\NewRelic\newrelic-infra\integrations.d` | 1.0.2   |

**custom_plugin_installation_dir**

Specifies a custom path to install integrations, which allows to install them outside the `agent_dir`. It has priority when the agent is looking for installed integrations.

| YML option name                  | Environment variable                  | Type   | Default | Version |
| -------------------------------- | ------------------------------------- | ------ | ------- | ------- |
| `custom_plugin_installation_dir` | `NRIA_CUSTOM_PLUGIN_INSTALLATION_DIR` | string | Empty   | 1.0.2   |

**safe_bin_dir**

Directory where the agent looks for executables for integrations.

| YML option name | Environment variable | Type   | Default                                                                           | Version |
| --------------- | -------------------- | ------ | --------------------------------------------------------------------------------- | ------- |
| `safe_bin_dir`  | `NRIA_SAFE_BIN_DIR`  | string | Linux: `/opt/newrelic-infra` Windows: `C:\Program Files\NewRelic\newrelic-infra\` | 1.48.0  |

**agent_temp_dir**

Directory where the agent stores temporary files (for example, log forwarder configuration and integration discovery data). This directory is deleted on every agent restart, but only if it still matches its default value.

| YML option name  | Environment variable  | Type   | Default                                                                                    | Version |
| ---------------- | --------------------- | ------ | ------------------------------------------------------------------------------------------ | ------- |
| `agent_temp_dir` | `NRIA_AGENT_TEMP_DIR` | string | Linux: `/var/db/newrelic-infra/tmp` Windows: `C:\ProgramData\New Relic\newrelic-infra\tmp` | 1.39.0  |

**logging_configs_dir**

Directory containing configuration files for the log forwarder.

| YML option name       | Environment variable       | Type   | Default                         | Version |
| --------------------- | -------------------------- | ------ | ------------------------------- | ------- |
| `logging_configs_dir` | `NRIA_LOGGING_CONFIGS_DIR` | string | `/etc/newrelic-infra/logging.d` | 1.0.2   |

**logging_home_dir**

Directory containing binaries and other required files for the log forwarder.

| YML option name    | Environment variable    | Type   | Default                                                                                                                                            | Version |
| ------------------ | ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `logging_home_dir` | `NRIA_LOGGING_HOME_DIR` | string | Linux: `/var/db/newrelic-infra/newrelic-integrations/logging/` Windows: `C:\Program Files\New Relic\newrelic-infra\newrelic-integrations\logging\` | 1.0.2   |

**logging_bin_dir**

Directory containing binaries for the log forwarder.

| YML option name   | Environment variable   | Type   | Default                                                 | Version |
| ----------------- | ---------------------- | ------ | ------------------------------------------------------- | ------- |
| `logging_bin_dir` | `NRIA_LOGGING_BIN_DIR` | string | `/var/db/newrelic-infra/newrelic-integrations/logging/` | 1.0.2   |

## Integrations variables

**passthrough_environment**

A list of environment variables that will be passed to all integrations. If an integration already has an existing configuration option with the same name, then the environment variable takes precedence.

Starting with infrastructure agent 1.24.1 `passthrough_environment` supports regex for variable names.

| YML option name           | Environment variable           | Type      | Default | Version                                                                                                                                                      |
| ------------------------- | ------------------------------ | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `passthrough_environment` | `NRIA_PASSTHROUGH_ENVIRONMENT` | \[]string | Empty   | [1.0.719](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10719) |

Example as a YAML attribute (inside the agent's configuration file, located by default in `/etc/newrelic-infra.yml`):

````yml
passthrough_environment:
  - HOST
  - PORT
  - NRIA_.*
```

Example as an environment variable:

```ini
NRIA_PASSTHROUGH_ENVIRONMENT="HOST,PORT,NRIA_.*"
```

For Windows hosts:
`PATHEXT` is an MS Windows environment variable. The function is to determine which file extensions mark files that are executable from every command line. This will resolve any errors reporting "... is not recognized as the name of a cmdlet, function, script file..." for common Flex integrations:

```yml
passthrough_environment:
  - PATHEXT
```

````

**entityname_integrations_v2_update**

The agent enables loopback-address replacement on the entity name (and therefore key) automatically for version 3 of the integration protocol. If you are using version 2 of the protocol and want this behavior, enable the `entityname_integrations_v2_update` option.

| YML option name                     | Environment variable                     | Type    | Default | Version |
| ----------------------------------- | ---------------------------------------- | ------- | ------- | ------- |
| `entityname_integrations_v2_update` | `NRIA_ENTITYNAME_INTEGRATIONS_V2_UPDATE` | boolean | `false` | 1.2.15  |

**http_server_enabled**

By setting this configuration parameter to `true` the agent will open an HTTP port (by default, `8001`) to receive data from the New Relic StatsD backend.

| YML option name       | Environment variable       | Type    | Default | Version                                                                                                                                                      |
| --------------------- | -------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `http_server_enabled` | `NRIA_HTTP_SERVER_ENABLED` | boolean | `false` | [1.0.818](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10818) |

**http_server_host**

By setting this value, the agent will start listening on the `HTTPServerPort` to receive data from the New Relic StatsD backend.

| YML option name    | Environment variable    | Type   | Default     | Version                                                                                                                                                      |
| ------------------ | ----------------------- | ------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `http_server_host` | `NRIA_HTTP_SERVER_HOST` | string | `localhost` | [1.0.818](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10818) |

**http_server_port**

Sets the port for the http server to receive data from the New Relic StatsD backend.

| YML option name    | Environment variable    | Type    | Default | Version                                                                                                                                                      |
| ------------------ | ----------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `http_server_port` | `NRIA_HTTP_SERVER_PORT` | integer | `8001`  | [1.0.818](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10818) |

**http_server_cert**

The path to a PEM-encoded certificate used to listen for integration payloads over HTTPS. When configured with `http_server_key`, the agent uses HTTPS for the integration payload server.

| YML option name    | Environment variable    | Type   | Default | Version                                                                                                                                                    |
| ------------------ | ----------------------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `http_server_cert` | `NRIA_HTTP_SERVER_CERT` | string | (none)  | [1.24.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1240) |

**http_server_key**

The path to a PEM-encoded key used to listen for integration payloads over HTTPS. When configured with `http_server_cert`, the agent uses HTTPS for the integration payload server.

| YML option name   | Environment variable   | Type   | Default | Version                                                                                                                                                    |
| ----------------- | ---------------------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `http_server_key` | `NRIA_HTTP_SERVER_KEY` | string | (none)  | [1.24.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1240) |

**http_server_ca**

The path to a PEM-encoded CA certificate used to enforce client certificate validation for HTTPS requests. When configured, the agent verifies client certificates against this CA to enable mutual TLS (mTLS) authentication for the integration payload server.

| YML option name  | Environment variable  | Type   | Default | Version                                                                                                                                                    |
| ---------------- | --------------------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `http_server_ca` | `NRIA_HTTP_SERVER_CA` | string | (none)  | [1.24.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1240) |

**remove_entities_period**

Starts the process of deleting entities that haven't reported information during this interval.

Valid time units: `s` (seconds), `m` (minutes), and `h` (hour).

| YML option name          | Environment variable          | Type   | Default | Version                                                                                                                                                      |
| ------------------------ | ----------------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `remove_entities_period` | `NRIA_REMOVE_ENTITIES_PERIOD` | string | `48h`   | [1.0.859](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10859) |

Example:

````
1h
```

````

**event_queue_depth**

If you have a large number of processes on the host, or a large volume of data collected across your integrations, the agent queue can overrun. Increase the queue depth to prevent error messages resulting from full queues.

| YML option name     | Environment variable     | Type  | Default | Version                                                                                                                                                     |
| ------------------- | ------------------------ | ----- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `event_queue_depth` | `NRIA_EVENT_QUEUE_DEPTH` | int64 | `1000`  | [1.12.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1120/) |

**default_integrations_temp_dir**

Defines the temp directory used as persisting storage for the integrations SDK synchronization.

| YML option name                 | Environment variable                 | Type   | Default                | Version                                                                                                                                                     |
| ------------------------------- | ------------------------------------ | ------ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `default_integrations_temp_dir` | `NRIA_DEFAULT_INTEGRATIONS_TEMP_DIR` | string | `/tmp/nr-integrations` | [1.50.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1500/) |

**is_integrations_only**

Use this setting if you're instrumenting the host from a source other than the infrastructure agent (for example, an OpenTelemetry Collector or Prometheus node exporter) and you want to keep using the infrastructure agent on-host integrations to monitor other infrastructure services.
When enabled, the agent reports host inventory and integrations telemetry (event metrics and inventory) decorated with host metadata, but host metrics (CPU, memory, disk, network, processes) are disabled.

| YML option name        | Environment variable        | Type    | Default | Version                                                                                                                                                     |
| ---------------------- | --------------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `is_integrations_only` | `NRIA_IS_INTEGRATIONS_ONLY` | boolean | `false` | [1.53.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1530/) |

## Inventory variables

**offline_time_to_reset**

If the cached inventory becomes older than this value (for example, because the agent is offline), the agent automatically removes and recreates the delta store.

| YML option name         | Environment variable         | Type   | Default | Version                                                                                                                                                      |
| ----------------------- | ---------------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `offline_time_to_reset` | `NRIA_OFFLINE_TIME_TO_RESET` | string | `24h`   | [1.0.888](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10888) |

**enable_async_inventory**

When set to true, enables the inventory asynchronous processing allowing larger inventory payloads to be processed.

| YML option name                   | Environment variable                   | Type | Default | Version                                                                                                                                                    |
| --------------------------------- | -------------------------------------- | ---- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `async_inventory_handler_enabled` | `NRIA_ASYNC_INVENTORY_HANDLER_ENABLED` | bool | `false` | [1.40.1](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1401) |

**ignored_inventory**

The list of inventory paths ignored by the agent.

| YML option name     | Environment variable     | Type      | Default    | Version                                                                                                                                                      |
| ------------------- | ------------------------ | --------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ignored_inventory` | `NRIA_IGNORED_INVENTORY` | string\[] | Empty list | [1.0.336](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10336) |

Example as a YAML attribute:

````yml
ignored_inventory:
  - files/config/stuff.bar
  - files/config/stuff.foo
```

Example as an environment variable:

```ini
NRIA_IGNORED_INVENTORY="files/config/stuff.bar,files/config/stuff.foo"
```

````

## Linux variables [#linux-variables]

**pid_file**

Location on Linux where the `pid` file of the agent process is created. It is used at startup to ensure that no other instances of the agent are running.

| YML option name | Environment variable | Type   | Default                                      | Version |
| --------------- | -------------------- | ------ | -------------------------------------------- | ------- |
| `pid_file`      | `NRIA_PID_FILE`      | string | `/var/run/newrelic-infra/newrelic-infra.pid` | 1.0.2   |

**ignore_reclaimable**

When true, formulation of the host virtual memory considers `SReclaimable` as available memory; otherwise `SReclaimable` will be considered part of the used memory.

| YML option name      | Environment variable      | Type    | Default | Version                                                                                                                                                  |
| -------------------- | ------------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ignore_reclaimable` | `NRIA_IGNORE_RECLAIMABLE` | boolean | `false` | [1.2.6](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-125) |

## Logging variables

**log**

Log is a key-value map used to configure the infrastructure agent logger.
Example as a YAML attribute:

````yml
log:
  file: '/var/log/newrelic-infra/newrelic-infra.log'
  level: debug
  forward: true
  stdout: false
```

Example as an environment variable:

```ini
NRIA_LOG_FILE='/var/log/newrelic-infra/newrelic-infra.log'
NRIA_LOG_LEVEL='smart'
NRIA_LOG_FORWARD='false'
NRIA_LOG_STDOUT='true'
```

<CollapserGroup>
  <Collapser
    className="freq-link"
    id="file"
    title="file"
  >
    Defines the file path for the logs.

    The default installation creates a log directory and it sets this filepath value in the `file` configuration option for you. This log directory is different for each OS, as shown below.

    Change this configuration option to customize the file path for the logs.

    <table>
      <thead>
        <tr>
          <th style={{ width: "200px" }}>
            YML option name
          </th>

          <th style={{ width: "200px" }}>
            Environment variable
          </th>

          <th>
            Type
          </th>

          <th>
            Default
          </th>

          <th>
            Version
          </th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            `file`
          </td>

          <td>
            `NRIA_LOG_FILE`
          </td>

          <td>
            string
          </td>

          <td>
            See below\*
          </td>

          <td/>
        </tr>
      </tbody>
    </table>

    Default paths:

    * Linux: If not defined, it logs only in the standard output.
    * Windows, agent version 1.0.944 or higher:

      ```
      C:\%ProgramData%\New Relic\newrelic-infra\newrelic-infra.log
      ```

      If the directory can't be created:

      ```
      C:\Program Files\New Relic\newrelic-infra\newrelic-infra.log
      ```
  </Collapser>

  <Collapser
    className="freq-link"
    id="level"
    title="level"
  >
    Defines the log level. Available values:

    * `info`: Displays log messages of level error, warn and info.
    * `smart`: Enables the [smart verbose mode](/docs/infrastructure/infrastructure-troubleshooting/troubleshoot-logs/infrastructure-agent-logging-behavior/#smart-verbose-mode). Smart verbose mode logs the last `smart_level_entry_limit` debug messages when an error is logged.
    * `debug`: Displays log messages of level error, warn, info and debug.
    * `trace`: All log messages will be shown.

      <Callout variant="important">
        Trace level logging can generate a lot of data very quickly. Run the agent in trace mode only for as long as necessary to reproduce your issue, then set `level: info` and [restart your agent](/docs/infrastructure/new-relic-infrastructure/configuration/start-stop-restart-check-infrastructure-agent-status) to disable verbose logging. Alternatively, you can set `level`: `smart`, which will enable smart verbose mode.
      </Callout>

      <table>
        <thead>
          <tr>
            <th style={{ width: "200px" }}>
              YML option name
            </th>

            <th style={{ width: "200px" }}>
              Environment variable
            </th>

            <th>
              Type
            </th>

            <th>
              Default
            </th>

            <th>
              Version
            </th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td>
              `level`
            </td>

            <td>
              `NRIA_LOG_LEVEL`
            </td>

            <td>
              string
            </td>

            <td>
              Not set
            </td>

            <td/>
          </tr>
        </tbody>
      </table>
  </Collapser>

  <Collapser
    className="freq-link"
    id="log-format"
    title="format"
  >
    Defines the log output format. Available values:

    * `text`: Plain text output, one line per log entry.
    * `json`: JSON-formatted output, one line per log entry.

      <table>
        <thead>
          <tr>
            <th style={{ width: "200px" }}>
              YML option name
            </th>

            <th style={{ width: "200px" }}>
              Environment variable
            </th>

            <th>
              Type
            </th>

            <th>
              Default
            </th>

            <th>
              Version
            </th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td>
              `format`
            </td>

            <td>
              `NRIA_LOG_FORMAT`
            </td>

            <td>
              string
            </td>

            <td>
              `text`
            </td>

            <td>
              [1.4.9](/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-149)
            </td>
          </tr>
        </tbody>
      </table>
  </Collapser>

  <Collapser
    className="freq-link"
    id="forward"
    title="forward"
  >
    Enables forwarding the agent logs to our logs UI. To disable it, set this configuration option to `false`.

    <table>
      <thead>
        <tr>
          <th style={{ width: "200px" }}>
            YML option name
          </th>

          <th style={{ width: "200px" }}>
            Environment variable
          </th>

          <th>
            Type
          </th>

          <th>
            Default
          </th>

          <th>
            Version
          </th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            `forward`
          </td>

          <td>
            `NRIA_LOG_FORWARD`
          </td>

          <td>
            boolean
          </td>

          <td>
            `false`
          </td>

          <td>
            [1.0.703](/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10703)
          </td>
        </tr>
      </tbody>
    </table>
  </Collapser>

  <Collapser
    className="freq-link"
    id="stdout"
    title="stdout"
  >
    By default all logs are displayed in both standard output and a log file. To disable logs in the standard output, set this configuration option to `false`.

    <table>
      <thead>
        <tr>
          <th style={{ width: "200px" }}>
            YML option name
          </th>

          <th style={{ width: "200px" }}>
            Environment variable
          </th>

          <th>
            Type
          </th>

          <th>
            Default
          </th>

          <th>
            Version
          </th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            `stdout`
          </td>

          <td>
            `NRIA_LOG_STDOUT`
          </td>

          <td>
            boolean
          </td>

          <td>
            `true`
          </td>

          <td>
            [1.0.703](/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10703)
          </td>
        </tr>
      </tbody>
    </table>
  </Collapser>

  <Collapser
    className="freq-link"
    id="smart_level_entry_limit"
    title="smart_level_entry_limit"
  >
    `smart_level_entry_limit` refers to the number of previous debug messages that will be logged when an error is logged. For example, if the limit is set to `5`, debug logs will be cached in memory until an error is logged, at which point the previous 5 debug messages will also be logged.

    <Callout variant="important">
      This configuration option is only used when `level` is set to `smart` (Smart Level enabled).
    </Callout>

    <table>
      <thead>
        <tr>
          <th style={{ width: "200px" }}>
            YML option name
          </th>

          <th style={{ width: "200px" }}>
            Environment variable
          </th>

          <th>
            Type
          </th>

          <th>
            Default
          </th>

          <th>
            Version
          </th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            `smart_level_entry_limit`
          </td>

          <td>
            `NRIA_SMART_LEVEL_ENTRY_LIMIT`
          </td>

          <td>
            integer
          </td>

          <td>
            `1000`
          </td>

          <td>
            [1.9.0](/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-190)
          </td>
        </tr>
      </tbody>
    </table>
  </Collapser>

  <Collapser
    className="freq-link"
    id="rotate"
    title="rotate"
  >
    From version [v1.28.0](/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes) on, you can use the built-in log rotation feature.
    By default, log rotation is disabled. To enable it, you have to specify the maximum size of the log file with the `max_size_mb` option.
    When the infrastructure agent log file reaches that size, the current log file will be rotated into a new file.

    ```yml
    log:
      level: info
      file: /var/log/newrelic-infra/newrelic-infra.log
      rotate:
        max_size_mb: 1000                        # Required
        max_files: 5                             # Optional
        compression_enabled: true                # Optional
        file_pattern: YYYY-MM-DD_hh-mm-ss.log    # Optional
    ```

    <CollapserGroup>
      <Collapser
        className="rotate-max_size_mb"
        id="rotate-max_size_mb"
        title="max_size_mb"
      >
        `max_size_mb` specifies the maximum size in MegaBytes of the infrastructure agent log file. When the file has reached this size, the current logs will be rotated into a new file.
        When the `max_size_mb` is `0`, built-in log rotation is disabled.

        <table>
          <thead>
            <tr>
              <th style={{ width: "200px" }}>
                YML option name
              </th>

              <th style={{ width: "200px" }}>
                Environment variable
              </th>

              <th>
                Type
              </th>

              <th>
                Default
              </th>

              <th>
                Version
              </th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td>
                `max_size_mb`
              </td>

              <td>
                `NRIA_LOG_ROTATE_MAX_SIZE_MB`
              </td>

              <td>
                integer
              </td>

              <td>
                `0` - Disabled
              </td>

              <td/>
            </tr>
          </tbody>
        </table>
      </Collapser>

      <Collapser
        className="rotate-max_files"
        id="rotate-max_files"
        title="max_files"
      >
        `max_files` defines how many archived log files will be keept. When this value is exceeded, older files will be removed.
        When the `max_files` is `0` the limit for the number of files is disabled.

        <table>
          <thead>
            <tr>
              <th style={{ width: "200px" }}>
                YML option name
              </th>

              <th style={{ width: "200px" }}>
                Environment variable
              </th>

              <th>
                Type
              </th>

              <th>
                Default
              </th>

              <th>
                Version
              </th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td>
                `max_files`
              </td>

              <td>
                `NRIA_LOG_ROTATE_MAX_FILES`
              </td>

              <td>
                integer
              </td>

              <td>
                `0`
              </td>

              <td/>
            </tr>
          </tbody>
        </table>
      </Collapser>

      <Collapser
        className="rotate-compression_enabled"
        id="rotate-compression_enabled"
        title="compression_enabled"
      >
        You can enable compression for the log files by setting `compression_enabled` to `true`. If compression is activated,
        rotated files will have a `gzip` format and will use less disk space.

        <Callout variant="important">
          During the log rotation, if compression is enabled, the agent CPU usage might increase, especially when `max_size_mb` value is greater than `1000`.
        </Callout>

        <table>
          <thead>
            <tr>
              <th style={{ width: "200px" }}>
                YML option name
              </th>

              <th style={{ width: "200px" }}>
                Environment variable
              </th>

              <th>
                Type
              </th>

              <th>
                Default
              </th>

              <th>
                Version
              </th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td>
                `compression_enabled`
              </td>

              <td>
                `NRIA_LOG_ROTATE_COMPRESSION_ENABLED`
              </td>

              <td>
                boolean
              </td>

              <td>
                `false`
              </td>

              <td/>
            </tr>
          </tbody>
        </table>
      </Collapser>

      <Collapser
        className="rotate-file_pattern"
        id="rotate-file_pattern"
        title="file_pattern"
      >
        `file_pattern` specifies the name format for the archived log files. By default, the new file name will use the following
        name pattern: `original-file_YYYY-MM-DD_hh-mm-ss.log`.

        You can customize the file name pattern with the following timestamp fields:

        * `YYYY`: Year
        * `MM`: Month
        * `DD`: Day
        * `hh`: Hour
        * `mm`: Minute
        * `ss`: Secound

          The agent will automatically replace those timestamp fields with the time of the file rotation. For example:

          ```yml
          log:
            level: info
            file: /var/log/newrelic-infra/newrelic-infra.log
            rotate:
              max_size_mb: 1000
              file_pattern: rotated.YYYY-MM-DD_hh-mm-ss.log
          ```

          <table>
            <thead>
              <tr>
                <th style={{ width: "200px" }}>
                  YML option name
                </th>

                <th style={{ width: "200px" }}>
                  Environment variable
                </th>

                <th>
                  Type
                </th>

                <th>
                  Default
                </th>

                <th>
                  Version
                </th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  `file_pattern`
                </td>

                <td>
                  `NRIA_LOG_ROTATE_FILE_PATTERN`
                </td>

                <td>
                  string
                </td>

                <td>
                  `file_YYYY-MM-DD_hh-mm-ss.file_extension`
                </td>

                <td/>
              </tr>
            </tbody>
          </table>
      </Collapser>
    </CollapserGroup>
  </Collapser>
</CollapserGroup>

````

> #### 💡 TIP
>
> Infrastructure agent version 1.28.0 introduced backward-compatible improvements in logging configuration.
> See our [github documentation](https://github.com/newrelic/infrastructure-agent/blob/master/docs/log_configuration.md) to understand the legacy settings and how to map them to the new structure.

## Metrics variables [#metrics]

**custom_attributes**

Custom attributes are key-value pairs (similar to tags in other tools) used to annotate the data from the infrastructure agent. You can use this metadata to filter your entities, [group your results](https://docs.newrelic.com/docs/infrastructure-group-results-specific-attributes), and annotate your data. For example, you might indicate a machine's environment (staging or production), the service a machine hosts (login service, for example), or the team responsible for that machine.

> #### 💡 TIP
>
> The agent collects many details about your environment as part of its [default attributes](https://docs.newrelic.com/docs/default-infrastructure-events-attributes), including [Amazon Elastic Compute Cloud (Amazon EC2) tags](https://docs.newrelic.com/docs/default-infrastructure-events-attributes#aws-ec2-attributes).

| YML option name     | Environment variable     | Type                    |
| ------------------- | ------------------------ | ----------------------- |
| `custom_attributes` | `NRIA_CUSTOM_ATTRIBUTES` | map\[string]interface{} |

Use a list of custom attributes to annotate the data from this agent instance. Separate keys and values with colons `:`, as in `KEY: VALUE`, and separate each key-value pair with a line break. Keys can be any valid YAML except slashes `/`. Values can be any YAML string, including spaces. Starting the key with `label.` will make sure it remains as is, even if that host might run in different cloud environments, where the cloud tags or cloud labels might interact with it in the combined decoration of tags. In contrast, `custom_labels` might be prefixed with `gcp.` or `azure.` when running in those environments and when combining data from the infrastructure agent with cloud monitoring together.

Example as a YAML attribute:

````yml
custom_attributes:
  label.environment: production
  label.service: login service
  label.team: alpha-team
```

Example as an environment variable:

```ini
NRIA_CUSTOM_ATTRIBUTES='{"label.customAttribute_1":"SOME_ATTRIBUTE","label.customAttribute_2": "SOME_ATTRIBUTE_2"}'
```

NRQL example filtering by custom attribute:

```sql
FROM SystemSample SELECT * WHERE label.environment = 'production'
```

````

**enable_process_metrics**

> #### ⚠️ IMPORTANT
>
> Requires infrastructure agent version 1.12.0 or higher.
> Accounts created before July 20, 2020 and/or infrastructure agents installed using the new guided install have this variable enabled by default.

Enables the sending of [process metrics](/attribute-dictionary/?event=ProcessSample) to New Relic.

By default, the infrastructure agent doesn't send data about the operating system's processes. The agent still collects such data, unless `metrics_process_sample_rate` is set to `-1`.

To report metric data about all the operating system's processes, set `enable_process_metrics` to `true`. To disable, set to `false`.

Sending all process data could increase the volume of data sent to New Relic. To fine-tune which processes you want to monitor, configure [`include_matching_metrics`](#include-matching-metrics) or [`exclude_matching_metrics`](#exclude-matching-metrics).

By default, processes using low memory are excluded from being sampled. For more information, see [disable-zero-mem-process-filter](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/configuration/infrastructure-agent-configuration-settings#disable-zero-mem-process-filter).

| YML option name          | Environment variable          | Type    | Default | Version |
| ------------------------ | ----------------------------- | ------- | ------- | ------- |
| `enable_process_metrics` | `NRIA_ENABLE_PROCESS_METRICS` | boolean | `false` |         |

**process_container_decoration**

When enabled, the agent decorates process samples with container information if the process is executed in a container.

This information includes the container ID, container name, image ID, image name, and container labels.

| YML option name                | Environment variable                | Type    | Default | Version |
| ------------------------------ | ----------------------------------- | ------- | ------- | ------- |
| `process_container_decoration` | `NRIA_PROCESS_CONTAINER_DECORATION` | boolean | `true`  | 1.55.0  |

**include_matching_metrics**

> #### ⚠️ IMPORTANT
>
> Currently, this setting only applies to an operating system's processes metrics.

You can control how much data is sent to New Relic by configuring `include_matching_metrics`, which allows you to restrict the transmission of metric data based on the values of metric [attributes](https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/nrql-query-tutorials/query-infrastructure-dimensional-metrics-nrql#naming-conventions).

You include metric data by defining literal or partial values for any of the attributes of the metric. For example, you can choose to send the `host.process.cpuPercent` of all processes whose `process.name` match the `^java` [regular expression](https://github.com/google/re2/wiki/Syntax).

In this example, we include process metrics using executable files and names:

````yml
include_matching_metrics:          # You can combine attributes from different metrics
  process.name:
    - regex "^java"                # Include all processes starting with "java"
  process.executable:
    - "/usr/bin/python2"           # Include the Python 2.x executable
    - regex "\\System32\\svchost"  # Include all svchost executables
```

If you need to include command line arguments in any of the values, set [`strip_command_line`](#strip-command-line) to false (the infrastructure agents removes CLI arguments by default to prevent secrets from leaking).

If both `include_matching_metrics` and `exclude_matching_metrics` are present for the same item, the inclusion takes precedence.

To configure `include_matching_metrics` as an environment variable for the [Kubernetes integration](/docs/integrations/kubernetes-integration), add it in the manifest inside the `env:` object:

```yml
env:
  - name: NRIA_INCLUDE_MATCHING_METRICS
    value: |
      process.name:
        - regex "^java"
      process.executable:
        - "/usr/bin/python2"
        - regex "\\System32\\svchost"
```

Default

<table>
  <thead>
    <tr>
      <th style={{ width: "200px" }}>
        YML option name
      </th>

      <th style={{ width: "200px" }}>
        Environment variable
      </th>

      <th>
        Type
      </th>

      <th>
        Default
      </th>

      <th>
        Version
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `include_matching_metrics`
      </td>

      <td>
        `NRIA_INCLUDE_MATCHING_METRICS`
      </td>

      <td>
        metric.attribute:

        \- regex "pattern"

        \- "string"

        \- "string-with-wildcard\*"
      </td>

      <td/>

      <td/>
    </tr>
  </tbody>
</table>

````

**exclude_matching_metrics**

> #### ⚠️ IMPORTANT
>
> Currently, this setting only applies to an operating system's processes metrics.

You can control how much data is sent to New Relic by configuring `exclude_matching_metrics`, which allows you to restrict the transmission of metric data based on the values of metric [attributes](https://docs.newrelic.com/docs/nrql/using-nrql/query-infrastructure-dimensional-metrics-nrql/#naming-conventions).

You exclude metric data by defining literal or partial values for any of the attributes of the metric. For example, you can choose not to send the `host.process.cpuPercent` of all processes whose `process.name` match the `^java` [regular expression](https://github.com/google/re2/wiki/Syntax).

In this example, we exclude process metrics using executable files and names:

````yml
exclude_matching_metrics:          # You can combine attributes from different metrics
  process.name:
    - regex "^java"                # Exclude all processes starting with "java"
  process.executable:
    - "/usr/bin/python2"           # Exclude the Python 2.x executable
    - regex "\\System32\\svchost"  # Exclude all svchost executables
```

To configure `exclude_matching_metrics` as an environment variable for the [Kubernetes integration](/docs/kubernetes-pixie/kubernetes-integration/get-started/introduction-kubernetes-integration/), add it in the manifest inside the `env:` object:

```yml
env:
  - name: NRIA_EXCLUDE_MATCHING_METRICS
    value: |
      process.name:
        - regex "^java"
      process.executable:
        - "/usr/bin/python2"
        - regex "\\System32\\svchost"
```

Default

<table>
  <thead>
    <tr>
      <th style={{ width: "200px" }}>
        YML option name
      </th>

      <th style={{ width: "200px" }}>
        Environment variable
      </th>

      <th>
        Type
      </th>

      <th>
        Default
      </th>

      <th>
        Version
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `exclude_matching_metrics`
      </td>

      <td>
        `NRIA_EXCLUDE_MATCHING_METRICS`
      </td>

      <td>
        metric.attribute:

        \- regex "pattern"

        \- "string"

        \- "string-with-wildcard\*"
      </td>

      <td/>
        1.57.0
      <td/>
    </tr>
  </tbody>
</table>

````

**network_interface_filters**

You can use the network interface filters configuration to hide unused or uninteresting network interfaces from the infrastructure agent. This helps reduce resource usage, work, and noise in your data.

> #### ⚠️ IMPORTANT
>
> Environment variables are not supported for this configuration setting.

The configuration uses a simple pattern-matching mechanism that can look for interfaces that start with a specific sequence of letters or numbers following either pattern:

-   `{name}[other characters]`, where you specify the name using the `prefix` option
-   `[number]{name}[other characters]`, where you specify the name using the `index-1` option

    New Relic infrastructure implements a curated default list of filters, available for both [Linux](#filters-linux) and [Windows](#filters-windows), that you can modify.

    | YML option name             | Environment variable | Type                  | Default | Version |
    | --------------------------- | -------------------- | --------------------- | ------- | ------- |
    | `network_interface_filters` | not supported        | map\[string]\[]string |         | 1.0.220 |

    **Linux**

    Default network interface filters for Linux:

    -   Network interfaces that start with `dummy`, `lo`, `vmnet`, `sit`, `tun`, `tap`, or `veth`
    -   Network interfaces that contain `tun` or `tap`

        The following example (added to your configuration file) overrides the default filters. This will ignore network interfaces that start with `dummy` or `lo` , or contain `tun` preceded by a sequence of numbers, and followed by other characters:

        ```yml
        network_interface_filters:
          prefix:
            - dummy
            - lo
          index-1:
            - tun
        ```

    **Windows**

    Default network interface filters for Windows:

    -   Network interfaces that start with `Loop`, `isatap`, or `Local`

        The following example (added to your configuration file) overrides the default filters. This will ignore network interfaces that start with `Loop`:

        ```yml
        network_interface_filters:
          prefix:
            - Loop
        ```

**disable_zero_mem_process_filter**

The `ZeroRSSFilter` excludes processes that are not using memory from being sampled. Disable the filter so that the agent includes these processes in the `ProcessSample`.

| YML option name                   | Environment variable                   | Type    | Default | Version |
| --------------------------------- | -------------------------------------- | ------- | ------- | ------- |
| `disable_zero_mem_process_filter` | `NRIA_DISABLE_ZERO_MEM_PROCESS_FILTER` | boolean | `false` | 1.0.832 |

## Plugins variables

> #### 💡 TIP
>
> You can quickly disable all the variables by setting [`DisableAllPlugins`](#disable-all-plugins) to `true`, and turn on only those options you need.

**disable_all_plugins**

To disable all the plugins, set this option to `true`.

| YML option name       | Environment variable       | Type    | Default | Version                                                                                                                                                  |
| --------------------- | -------------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `disable_all_plugins` | `NRIA_DISABLE_ALL_PLUGINS` | boolean | `false` | [1.2.1](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-121) |

**cloud_security_group_refresh_sec**

Sampling period for the `CloudSecurityGroups` plugin, in seconds. The minimum value is `30`. To disable it, set it to `-1`.

> #### ⚠️ IMPORTANT
>
> This plugin is activated only if the agent is running in an AWS instance.

| YML option name                    | Environment variable                    | Type  | Default | Version                                                                                                                                                      |
| ---------------------------------- | --------------------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `cloud_security_group_refresh_sec` | `NRIA_CLOUD_SECURITY_GROUP_REFRESH_SEC` | int64 | `60`    | [1.0.692](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10703) |

**daemontools_interval_sec**

Sampling period for the `Daemontools`plugin, in seconds. The minimum value is a `10`. To disable it, set it to `-1`.

| YML option name            | Environment variable            | Type  | Default | Version                                                                                                                                                      |
| -------------------------- | ------------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `daemontools_interval_sec` | `NRIA_DAEMONTOOLS_INTERVAL_SEC` | int64 | `15`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**dpkg_interval_sec**

Sampling period for the `Dpkg` plugin, in seconds. The minimum value is `30`. To disable it, set it to `-1`. If the parameter is not explicitly set in the config file, it can be disabled by setting [`DisableAllPlugins`](#disable-all-plugins) to `true`.

> #### ⚠️ IMPORTANT
>
> This is only activated in [`root` or `privileged` running modes](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/linux-installation/linux-agent-running-modes) and on [Debian-based distributions](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-linux#debian-based-root).

| YML option name     | Environment variable     | Type  | Default | Version                                                                                                                                                      |
| ------------------- | ------------------------ | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `dpkg_interval_sec` | `NRIA_DPKG_INTERVAL_SEC` | int64 | `30`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**facter_interval_sec**

Sampling period for the `Facter` plugin, in seconds. The minimum value is `30`. To disable it, set it to `-1`.

| YML option name       | Environment variable       | Type  | Default | Version                                                                                                                                                      |
| --------------------- | -------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `facter_interval_sec` | `NRIA_FACTER_INTERVAL_SEC` | int64 | `30`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**kernel_modules_refresh_sec**

Sampling period for the `KernelModules` plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

> #### ⚠️ IMPORTANT
>
> `kernel_modules_refresh_sec` is only activated in [`root` or `privileged` running modes](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/linux-installation/linux-agent-running-modes).

| YML option name              | Environment variable              | Type  | Default | Version |
| ---------------------------- | --------------------------------- | ----- | ------- | ------- |
| `kernel_modules_refresh_sec` | `NRIA_KERNEL_MODULES_REFRESH_SEC` | int64 | `10`    | 1.0.755 |

**network_interface_interval_sec**

Sampling period for the `NetworkInterface` plugin, in seconds. The minimum value is `30`. To disable it, set it to `-1`.

| YML option name                  | Environment variable                  | Type  | Default | Version |
| -------------------------------- | ------------------------------------- | ----- | ------- | ------- |
| `network_interface_interval_sec` | `NRIA_NETWORK_INTERFACE_INTERVAL_SEC` | int64 | `60`    | 1.0.329 |

**rpm_interval_sec**

Sampling period for the `Rpm` plugin, in seconds. The minimum value is `30`. To disable it, set it to `-1`.

> #### ⚠️ IMPORTANT
>
> `rpm_interval_sec` is only activated when the agent runs in [root or privileged modes](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/linux-installation/linux-agent-running-modes) for RedHat, RedHat AWS, or SUSE distributions.

| YML option name    | Environment variable    | Type  | Default | Version                                                                                                                                                      |
| ------------------ | ----------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `rpm_interval_sec` | `NRIA_RPM_INTERVAL_SEC` | int64 | `30`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**selinux_interval_sec**

Sampling period for the `SELinux` plugin, in seconds. The minimum value is `30`. To disable it, set it to `-1`. This option is ignored if `SelinuxEnableSemodule` is set to false. For more information, see our troubleshooting doc on [disabling the `SELinux` module](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/troubleshooting/reduce-infrastructure-agents-cpu-footprint).

> #### ⚠️ IMPORTANT
>
> `SELinux` is only activated when the agent runs in [root mode](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/linux-installation/linux-agent-running-modes).

| YML option name        | Environment variable        | Type  | Default | Version                                                                                                                                                      |
| ---------------------- | --------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `selinux_interval_sec` | `NRIA_SELINUX_INTERVAL_SEC` | int64 | `30`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**sshd_config_refresh_sec**

Sampling period for the `Sshd` plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name           | Environment variable           | Type  | Default | Version |
| ------------------------- | ------------------------------ | ----- | ------- | ------- |
| `sshd_config_refresh_sec` | `NRIA_SSHD_CONFIG_REFRESH_SEC` | int64 | `15`    | 1.0.755 |

**supervisor_interval_sec**

Sampling period for the `Supervisor` plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name           | Environment variable           | Type  | Default | Version                                                                                                                                                      |
| ------------------------- | ------------------------------ | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `supervisor_interval_sec` | `NRIA_SUPERVISOR_INTERVAL_SEC` | int64 | `15`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**sysctl_interval_sec**

Sampling period for the `Sysctl` plugin, in seconds. The minimum value is `30`. To disable it, set it to `-1`.

| YML option name       | Environment variable       | Type  | Default | Version                                                                                                                                                      |
| --------------------- | -------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `sysctl_interval_sec` | `NRIA_SYSCTL_INTERVAL_SEC` | int64 | `60`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**systemd_interval_sec**

Sampling period for the `Systemd` plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name        | Environment variable        | Type  | Default | Version                                                                                                                                                      |
| ---------------------- | --------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `systemd_interval_sec` | `NRIA_SYSTEMD_INTERVAL_SEC` | int64 | `30`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**sysvinit_interval_sec**

Sampling period for the `sysv` plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name         | Environment variable         | Type  | Default | Version                                                                                                                                                      |
| ----------------------- | ---------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `sysvinit_interval_sec` | `NRIA_SYSVINIT_INTERVAL_SEC` | int64 | `30`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**upstart_interval_sec**

Sampling period for the `Upstart` plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name        | Environment variable        | Type  | Default | Version                                                                                                                                                      |
| ---------------------- | --------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `upstart_interval_sec` | `NRIA_UPSTART_INTERVAL_SEC` | int64 | `30`    | [1.0.316](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10316) |

**users_refresh_sec**

Sampling period for the `Users` plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name     | Environment variable     | Type  | Default | Version |
| ------------------- | ------------------------ | ----- | ------- | ------- |
| `users_refresh_sec` | `NRIA_USERS_REFRESH_SEC` | int64 | `30`    | 1.0.755 |

**supervisor_rpc_sock**

Location of the [supervisor](http://www.supervisord.org/) socket.

| YML option name       | Environment variable       | Type   | Default                    | Version |
| --------------------- | -------------------------- | ------ | -------------------------- | ------- |
| `supervisor_rpc_sock` | `NRIA_SUPERVISOR_RPC_SOCK` | string | `/var/run/supervisor.sock` | 1.0.2   |

**facter_home_dir**

Sets the `HOME` environment variable for [Puppet's Facter](https://puppet.com/docs/puppet/latest/puppet_index.html). If not defined, it defaults to the current user's home directory.

| YML option name   | Environment variable   | Type   | Default | Version                                                                                                                                                  |
| ----------------- | ---------------------- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `facter_home_dir` | `NRIA_FACTER_HOME_DIR` | string |         | [1.1.7](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-117) |

## Proxy variables

For infrastructure agent version 1.3.1 or higher, the precedence of the proxy configuration settings is:

-   `NRIA_PROXY`
-   `proxy`
-   `HTTP_PROXY`
-   `HTTPS_PROXY`

**proxy**

Your system may have firewall rules that require the agent to use a proxy to communicate with New Relic. If so, set the proxy URL in the form https&#x3A;//user:password@hostname:port. It can be HTTP or HTTPS.

| YML option name | Environment variable | Type   | Default | Version                                                                                                                                                      |
| --------------- | -------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `proxy`         | `NRIA_PROXY`         | string | Empty   | [1.0.308](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10308) |

Example:

````
https://proxy_user:access_10@proxy_01:1080
```

````

**ignore_system_proxy**

When set to `true`, the `HTTPS_PROXY` and `HTTP_PROXY` environment variables are ignored. This is useful when the agent needs to connect directly to the metrics collector and skip the existing system proxy.

| YML option name       | Environment variable       | Type    | Default | Version                                                                                                                                                        |
| --------------------- | -------------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ignore_system_proxy` | `NRIA_IGNORE_SYSTEM_PROXY` | boolean | `false` | [1.0.1002](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-101002) |

**ca_bundle_dir**

If the `HTTPS_PROXY` option references to a proxy with self-signed certificates, this option specifies the path to the the directory where the proxy certificate is available. The certificates in the directory must end with the `.pem` extension.

| YML option name | Environment variable | Type   | Default | Version                                                                                                                                                      |
| --------------- | -------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ca_bundle_dir` | `NRIA_CA_BUNDLE_DIR` | string |         | [1.0.296](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10296) |

**ca_bundle_file**

If the `HTTPS_PROXY` option references to a proxy with self-signed certificates, this option specifies the path to the certificate file.

| YML option name  | Environment variable  | Type   | Default | Version                                                                                                                                                      |
| ---------------- | --------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ca_bundle_file` | `NRIA_CA_BUNDLE_FILE` | string |         | [1.0.296](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10296) |

**proxy_validate_certificates**

If set to `true`, when the proxy is configured to use an HTTPS connection, it will only work:

-   If the HTTPS proxy has certificates from a valid Certificate Authority.
-   If the `ca_bundle_file` or `ca_bundle_dir` configuration properties contain the HTTPS proxy certificates.

    | YML option name               | Environment variable               | Type    | Default | Version |
    | ----------------------------- | ---------------------------------- | ------- | ------- | ------- |
    | `proxy_validate_certificates` | `NRIA_PROXY_VALIDATE_CERTIFICATES` | boolean | `false` | 1.3.0   |

**proxy_config_plugin**

Sends the following proxy configuration information as inventory:

-   `HTTPS_PROXY`
-   `HTTP_PROXY`
-   `proxy ca_bundle_dir`
-   `ca_bundle_file`
-   `ignore_system_proxy`
-   `proxy_validate_certificates`

    | YML option name       | Environment variable       | Type    | Default | Version |
    | --------------------- | -------------------------- | ------- | ------- | ------- |
    | `proxy_config_plugin` | `NRIA_PROXY_CONFIG_PLUGIN` | boolean | `true`  | 1.3.0   |

If you are having problems with proxy configuration, see [Proxy troubleshooting](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/troubleshooting/https-proxy-configuration-missing).

## Samples variables

**metrics_network_sample_rate**

Sample rate of network samples, in seconds. Minimum value is `10`. To disable it, set it to `-1`.

| YML option name               | Environment variable               | Type    | Default | Version                                                                                                                                                      |
| ----------------------------- | ---------------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `metrics_network_sample_rate` | `NRIA_METRICS_NETWORK_SAMPLE_RATE` | integer | `10`    | [1.0.308](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10308) |

**metrics_process_sample_rate**

Sample rate of process samples, in seconds. Minimum value is `20`. To disable process samples entirely, set `metrics_process_sample_rate` to `-1`.

| YML option name               | Environment variable               | Type    | Default | Version                                                                                                                                                      |
| ----------------------------- | ---------------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `metrics_process_sample_rate` | `NRIA_METRICS_PROCESS_SAMPLE_RATE` | integer | `20`    | [1.0.308](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10308) |

**metrics_storage_sample_rate**

Sample rate of storage samples, in seconds. Minimum value is `5`. To disable it, set it to `-1`.

| YML option name               | Environment variable               | Type    | Default | Version                                                                                                                                                      |
| ----------------------------- | ---------------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `metrics_storage_sample_rate` | `NRIA_METRICS_STORAGE_SAMPLE_RATE` | integer | `20`    | [1.0.308](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10308) |

**metrics_system_sample_rate**

Sample rate of system samples, in seconds. Minimum value is `5`. To disable it, set it to `-1`.

| YML option name              | Environment variable              | Type    | Default | Version                                                                                                                                                      |
| ---------------------------- | --------------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `metrics_system_sample_rate` | `NRIA_METRICS_SYSTEM_SAMPLE_RATE` | integer | `5`     | [1.0.308](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10308) |

**metrics_nfs_sample_rate**

Sample rate of NFS storage samples, in seconds. Minimum value is `5`. To disable it, set it to `-1`.

| YML option name           | Environment variable           | Type    | Default | Version                                                                                                                                                    |
| ------------------------- | ------------------------------ | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `metrics_nfs_sample_rate` | `NRIA_METRICS_NFS_SAMPLE_RATE` | integer | `20`    | [1.5.40](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1540) |

**detailed_nfs**

Detailed NFS metrics. When enabled, the agent will provide a complete list of NFS metrics.

| YML option name | Environment variable | Type    | Default | Version                                                                                                                                                    |
| --------------- | -------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `detailed_nfs`  | `NRIA_DETAILED_NFS`  | boolean | `false` | [1.5.40](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1540) |

## NTP Offset variables

`ntp_metrics` is a key-value map used to configure the time offset metric. When enabled and an NTP Hosts list is provided,
the agent will provide the host's `ntp offset` metric (in seconds). This value is checked against the provided NTP
hosts pool every `interval` minutes (the default and the minumum value is 15 minutes). Between intervals, the last known offset is reported.
If the reported offset is greater than few seconds it can cause issues with alert conditions, NRQL queries and data gaps in dashboards.

Example as a YAML attribute:

```yml
ntp_metrics:
  enabled: true
  pool:
    - time.cloudflare.com
    - time.google.com
  interval: 15
  timeout: 10
```

Example as an environment variable:

```ini
NRIA_NTP_METRICS_POOL='time.cloudflare.com,time.google.com'
NRIA_NTP_METRICS_ENABLED='true'
NRIA_NTP_METRICS_INTERVAL='15'
NRIA_NTP_METRICS_TIMEOUT='10'
```

**ntp_metrics.enabled**

Flag to enable/disable the NTP Offset metric.

| YML option name | Environment variable       | Type    | Default | Version                                                                                                                                                    |
| --------------- | -------------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enabled`       | `NRIA_NTP_METRICS_ENABLED` | boolean | `false` | [1.33.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1330) |

**ntp_metrics.pool**

Defines list of NTP Hosts to query. When multiple hosts are defined, all of them will be queried and the reported
metrics will be the average value between them.

| YML option name | Environment variable    | Type      | Default                                                                                             | Version                                                                                                                                                    |
| --------------- | ----------------------- | --------- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pool`          | `NRIA_NTP_METRICS_POOL` | \[]string | Empty. Check out the [public NTP servers](https://timetoolsltd.com/information/public-ntp-server/). | [1.33.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1330) |

**ntp_metrics.interval**

Defines the interval in minutes to request NTP Offset from the provided pool.

| YML option name | Environment variable        | Type    | Default | Version                                                                                                                                                    |
| --------------- | --------------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `interval`      | `NRIA_NTP_METRICS_INTERVAL` | integer | `15`    | [1.33.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1330) |

**ntp_metrics.timeout**

Defines the timeout in seconds for the requests made to the NTP hosts.

| YML option name | Environment variable       | Type    | Default | Version                                                                                                                                                    |
| --------------- | -------------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `timeout`       | `NRIA_NTP_METRICS_TIMEOUT` | integer | `10`    | [1.33.0](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1330) |

## Security variables

**selinux_enable_semodule**

Get versions of policy modules installed using SEModule. If disabled, the SELinux plugin will only retrieve the status using SEStatus.

| YML option name           | Environment variable           | Type    | Default | Version |
| ------------------------- | ------------------------------ | ------- | ------- | ------- |
| `selinux_enable_semodule` | `NRIA_SELINUX_ENABLE_SEMODULE` | boolean | `true`  | 1.0.864 |

**strip_command_line**

When `true`, the agent removes the command arguments from the `commandLine` attribute of the `ProcessSample`.

> #### 💡 TIP
>
> This is a security measure to prevent leaking sensitive information.

| YML option name      | Environment variable      | Type    | Default | Version |
| -------------------- | ------------------------- | ------- | ------- | ------- |
| `strip_command_line` | `NRIA_STRIP_COMMAND_LINE` | boolean | `true`  | 1.0.149 |

## Status endpoint variables

**status_server_enabled**

Enables the status server on the agent providing local health information.
The available endpoints are:

Main status endpoint example (with no errors):

````bash
curl http://localhost:8003/v1/status
[output] {
[output]   "checks": {
[output]     "endpoints": [
[output]       {
[output]         "url": "https://infrastructure-command-api.newrelic.com/agent_commands/v1/commands",
[output]         "reachable": true
[output]       },
[output]       {
[output]         "url": "https://infra-api.newrelic.com/infra/v2/metrics",
[output]         "reachable": true
[output]       },
[output]       {
[output]         "url": "https://identity-api.newrelic.com/identity/v1",
[output]         "reachable": true
[output]       },
[output]       {
[output]         "url": "https://infra-api.newrelic.com/inventory",
[output]         "reachable": true
[output]       }
[output]     ]
[output]   },
[output]   "config": {
[output]     "reachability_timeout": "10s"
[output]   }
[output] }
```

Main status endpoint (with errors):

```bash
curl http://localhost:8003/v1/status
[output] {
[output]   "checks": {
[output]     "endpoints": [
[output]       {
[output]         "url": "https://staging-infra-api.newrelic.com/infra/v2/metrics",
[output]         "reachable": false,
[output]         "error": "endpoint check timeout exceeded"
[output]       },
[output]       {
[output]         "url": "https://infra-api.newrelic.com/infra/v2/metrics",
[output]         "reachable": true
[output]       },
[output]       {
[output]         "url": "https://identity-api.newrelic.com/identity/v1",
[output]         "reachable": true
[output]       },
[output]       {
[output]         "url": "https://infra-api.newrelic.com/inventory",
[output]         "reachable": true
[output]       }
[output]     ]
[output]   },
[output]   "config": {
[output]     "reachability_timeout": "10s"
[output]   }
[output] }
```

Errors endpoint example:

```bash
curl http://localhost:18003/v1/status/errors
[output] {
[output]   "checks": {
[output]     "endpoints": [
[output]       {
[output]         "url": "https://staging-infra-api.newrelic.com/infra/v2/metrics",
[output]         "reachable": false,
[output]         "error": "endpoint check timeout exceeded"
[output]       }
[output]     ]
[output]   },
[output]   "config": {
[output]     "reachability_timeout": "10s"
[output]   }
[output] }
```

This is similar to the main status endpoint but filtering those with errors only.

Entity endpoint example:

```bash
curl http://localhost:8003/v1/status/entity
[output] {
[output]   "guid":"MMMMNjI0NjR8SU5GUkF8TkF8ODIwMDg3MDc0ODE0MTUwNTMy",
[output]   "key":"your-host-name"
[output] }
```

Returns information about the agent/host entity. A response status code _204_ ("No Content") will be returned when the agent still has no information
about the agent/host entity. Therefore, it may take several requests to until the agent provides entity data.

<Callout variant="important">
  This setting is enabled by default when you use the guided install. It helps confirm that the agent installation was successful.
</Callout>

<table>
  <thead>
    <tr>
      <th style={{ width: "200px" }}>
        YML option name
      </th>

      <th style={{ width: "200px" }}>
        Environment variable
      </th>

      <th>
        Type
      </th>

      <th>
        Default
      </th>

      <th>
        Version
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `status_server_enabled`
      </td>

      <td>
        `NRIA_STATUS_SERVER_ENABLED`
      </td>

      <td>
        boolean
      </td>

      <td>
        `false`
      </td>

      <td>
        1.19.0
      </td>
    </tr>
  </tbody>
</table>

````

**status_server_port**

Defines the port for the status server endpoint.

| YML option name      | Environment variable      | Type    | Default | Version |
| -------------------- | ------------------------- | ------- | ------- | ------- |
| `status_server_port` | `NRIA_STATUS_SERVER_PORT` | integer | `8003`  | 1.19.0  |

## Windows variables

**windows_services_refresh_sec**

Sampling period for the Windows services plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name                | Environment variable                | Type  | Default | Version                                                                                                                                                      |
| ------------------------------ | ----------------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `windows_services_refresh_sec` | `NRIA_WINDOWS_SERVICES_REFRESH_SEC` | int64 | `30`    | [1.0.755](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10775) |

**windows_updates_refresh_sec**

Sampling period for the Windows updates plugin, in seconds. The minimum value is `10`. To disable it, set it to `-1`.

| YML option name               | Environment variable               | Type  | Default | Version                                                                                                                                                      |
| ----------------------------- | ---------------------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `windows_updates_refresh_sec` | `NRIA_WINDOWS_UPDATES_REFRESH_SEC` | int64 | `60`    | [1.0.755](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10775) |

**app_data_dir**

Defines the path to store data in a different path than the program files directory:

-   `%AppDir%/data`: Used for storing the delta data
-   `%AppDir%/user_data`: External directory for user-generated JSON files
-   `%AppDir%/newrelic-infra.log`: If log file config option is not defined, then we use this directory path as default.

    | YML option name | Environment variable | Type   | Default                                                                    | Version                                                                                                                                                      |
    | --------------- | -------------------- | ------ | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | `app_data_dir`  | `NRIA_APP_DATA_DIR`  | string | Windows: `env(ProgramData)\New Relic\newrelic-infra` Linux: Not applicable | [1.0.755](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-10775) |

**enable_win_update_plugin**

Enables the Windows updates plugin, which retrieves the lists of hotfixes that are installed on the host.

| YML option name            | Environment variable            | Type    | Default | Version |
| -------------------------- | ------------------------------- | ------- | ------- | ------- |
| `enable_win_update_plugin` | `NRIA_ENABLE_WIN_UPDATE_PLUGIN` | boolean | `false` | 1.0.274 |

**legacy_storage_sampler**

If `true`, the agent will be forced to use Windows WMI (the agent's legacy method to grab metrics for Windows; for example, `StorageSampler`) and will disable the new method (which uses the PDH library).

| YML option name          | Environment variable          | Type    | Default | Version                                                                                                                                                        |
| ------------------------ | ----------------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `legacy_storage_sampler` | `NRIA_LEGACY_STORAGE_SAMPLER` | boolean |         | [1.0.1051](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-101051) |

**win_process_priority_class**

This configuration option allows to increase the `newrelic-infra.exe` process priority to any of the following values:

-   `Normal`
-   `Idle`
-   `High`
-   `RealTime`
-   `BelowNormal`
-   `AboveNormal`

    | YML option name              | Environment variable              | Type   | Default | Version |
    | ---------------------------- | --------------------------------- | ------ | ------- | ------- |
    | `win_process_priority_class` | `NRIA_WIN_PROCESS_PRIORITY_CLASS` | string |         | 1.0.989 |

    Example:

    ```
    Normal
    ```

**win_removable_drives**

Enables the Windows agent to report drives `A:` and `B:` when they are mapped as removable drives.

| YML option name        | Environment variable        | Type    | Default | Version                                                                                                                                                  |
| ---------------------- | --------------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `win_removable_drives` | `NRIA_WIN_REMOVABLE_DRIVES` | boolean | `true`  | [1.3.1](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-131) |

**win_network_interface_v2**

When enabled, the Windows agent uses `GetIfEntry2` (64-bit counters) instead of `GetIfEntry` (32-bit counters) for network metrics. This provides more accurate network statistics for high-bandwidth interfaces where 32-bit counters may overflow.

> #### 💡 TIP
>
> This flag is kept for backward compatibility and may be removed in a future release.

| YML option name            | Environment variable            | Type    | Default | Version                                                                                                                                                    |
| -------------------------- | ------------------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `win_network_interface_v2` | `NRIA_WIN_NETWORK_INTERFACE_V2` | boolean | `true`  | [1.72.1](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1721) |

**wmi_proc_data**

If you set it to true, you'll get process information from WMI and you'll skip the query access check on a restricted environment.

| YML option name        | Environment variable        | Type    | Default | Version                                                                                                                                                   |
| ---------------------- | --------------------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enable_wmi_proc_data` | `NRIA_ENABLE_WMI_PROC_DATA` | boolean | `false` | [1.3.1](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/new-relic-infrastructure-agent-1420) |

## HTTP Client

Configure the HTTP client used for backend communication.

**http_headers**

Custom HTTP headers to include in all requests to the New Relic backend.

````yml
http:
  headers:
    "Proxy-Authorization": "myToken"
```

<table>
  <thead>
    <tr>
      <th style={{ width: "200px" }}>
        YML option name
      </th>

      <th style={{ width: "200px" }}>
        Environment variable
      </th>

      <th>
        Type
      </th>

      <th>
        Version
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `headers`
      </td>

      <td>
        `NRIA_HTTP_HEADERS`
      </td>

      <td>
        key-value map
      </td>

      <td>
        [1.41.0](/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes/)
      </td>
    </tr>
  </tbody>
</table>

````

## What's next?

You can also:

-   Further understand [the configuration of the agent](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/configure-infrastructure-agent).
-   Create a [configuration file using our template](https://github.com/newrelic/infrastructure-agent/blob/master/assets/examples/infrastructure/newrelic-infra-template.yml.example).
-   See how you can [manage the agent](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/start-stop-restart-check-infrastructure-agent-status).
