---
title: Ruby agent configuration
source: https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration
---

This file is automatically generated from values defined in `lib/new_relic/agent/configuration/default_source.rb`.
Make all changes directly to `default_source.rb.`
Submit PRs or raise issues at: <https://github.com/newrelic/newrelic-ruby-agent>

You can configure the New Relic Ruby agent with settings in a configuration file, environment variables, or programmatically with server-side configuration. This document summarizes the configuration options available for the Ruby agent.

If the default value for a configuration option is `(Dynamic)`, this means the Ruby agent calculates the default at runtime. The value for the config setting defaults to the value of another setting as appropriate.

## Configuration methods and precedence [#Options]

The primary (default) method to configure the Ruby agent is via the configuration file (`newrelic.yml`) in the `config` subdirectory. To set configuration values using environment variables:

1.  Add the prefix `NEW_RELIC_` to the setting's name.
2.  Replace any periods `.` with underscores `_`.

You can also configure a few values in the UI via [server-side configuration](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/server-side-agent-configuration).

The Ruby agent follows this order of precedence for configuration:

1.  Environment variables
2.  Server-side configuration
3.  Configuration file (`newrelic.yml`)
4.  Default configuration settings

In other words, environment variables override all other configuration settings and info, server-side configuration overrides the configuration file and default config settings, and so on.

## View and edit config file options [#Edit]

The Ruby agent's `newrelic.yml` is a standard YAML configuration file. It typically includes a `Defaults` section at the top, plus sections below for each application environment (`Development`, `Test`, `Staging`, and `Production`).

The Ruby agent determines which section of the `newrelic.yml` config file to read from by looking at certain environment variables to derive the application's environment. This can be useful when you want to use `info` for the `log_level` config setting in your production environment, and you want more verbose `log_level` config settings (such as `debug`) in your development environment.

Here is an example `newrelic.yml` config file:

```yaml
common: &default_settings
  license_key: 'YOUR_LICENSE_KEY'
  app_name: 'My Application Name'
production:
  <<: *default_settings
  log_level: info
development:
  <<: *default_settings
  log_level: debug
```

The Ruby agent looks for the following environment variables, in this order, to find the application environment:

1.  `NEW_RELIC_ENV`
2.  `RUBY_ENV`
3.  `RAILS_ENV`
4.  `APP_ENV`
5.  `RACK_ENV`

If the Ruby agent doesn't detect values for any of those environment variables, it will default the application environment to `development` and read from the `development` section of the `newrelic.yml` config file.

When running the Ruby agent in a Rails app, the agent first looks for the `NEW_RELIC_ENV` environment variable to find the application environment and which section of the `newrelic.yml` to use. If `NEW_RELIC_ENV` is not present, the agent uses the Rails environment (`RAILS_ENV`).

When you edit the config file, be sure to:

-   Indent only with two spaces.
-   Indent only where relevant, in sections such as **`error_collector`**.

If you do not indent correctly, the agent may throw an `Unable to parse configuration file` error on startup.

To view the most current list of available Ruby agent configuration options, use the `rake newrelic:config:docs` command. This document describes the most common options.

## Update the config file [#Updates]

This documentation applies to the Ruby agent's latest release. For details on earlier versions, refer to the comments in `newrelic.yml` itself.

To update `newrelic.yml` file after a new release, use the template in the base directory of the agent gem. When you update to new gem versions, examine or diff `config/newrelic.yml` and `newrelic.yml` in the [installation directory](https://docs.newrelic.com/docs/agents/manage-apm-agents/troubleshooting/find-agent-root-directory#ruby-agent) to take advantage of new configuration options.

> #### ⚠️ IMPORTANT
>
> Updating the gem does not automatically update `config/newrelic.yml`.

## General [#general]

These settings are available for agent configuration. Some settings depend on your New Relic subscription level.

**agent_enabled**

| TypeBoolean                             |
| --------------------------------------- |
| Defaulttrue                             |
| Environ variableNEW_RELIC_AGENT_ENABLED |

If `true`, allows the Ruby agent to run.

**app_name**

| TypeString                         |
| ---------------------------------- |
| Default(Dynamic)                   |
| Environ variableNEW_RELIC_APP_NAME |

Specify the [application name](https://docs.newrelic.com/docs/apm/new-relic-apm/installation-configuration/name-your-application) used to aggregate data in the New Relic UI. To report data to [multiple apps at the same time](https://docs.newrelic.com/docs/apm/new-relic-apm/installation-configuration/using-multiple-names-app), specify a list of names separated by a semicolon `;`. For example, `MyApp` or `MyStagingApp;Instance1`.

**license_key**

| TypeString                            |
| ------------------------------------- |
| Default""                             |
| Environ variableNEW_RELIC_LICENSE_KEY |

Your New Relic license key.

**log_level**

| TypeString                          |
| ----------------------------------- |
| Default"info"                       |
| Environ variableNEW_RELIC_LOG_LEVEL |

Sets the level of detail of log messages. Possible log levels, in increasing verbosity, are: `fatal`, `error`, `warn`, `info` or `debug`.

**active_support_custom_events_names**

| TypeArray                                                    |
| ------------------------------------------------------------ |
| Default\[]                                                   |
| Environ variableNEW_RELIC_ACTIVE_SUPPORT_CUSTOM_EVENTS_NAMES |

An array of ActiveSupport custom event names to subscribe to and instrument. For example: [one.custom.event, another.event, a.third.event]

**active_record_use_table_name**

| TypeBoolean                                            |
| ------------------------------------------------------ |
| Defaultfalse                                           |
| Environ variableNEW_RELIC_ACTIVE_RECORD_USE_TABLE_NAME |

If `true`, the agent will use the ActiveRecord model's table name instead of the class name when naming ActiveRecord metrics, spans, and transaction trace segments. This can reduce cardinality when multiple models share a database table. Defaults to `false`.

**backport_fast_active_record_connection_lookup**

| TypeBoolean                                                             |
| ----------------------------------------------------------------------- |
| Defaultfalse                                                            |
| Environ variableNEW_RELIC_BACKPORT_FAST_ACTIVE_RECORD_CONNECTION_LOOKUP |

Backports the faster ActiveRecord connection lookup introduced in Rails 6, which improves agent performance when instrumenting ActiveRecord. Note that this setting may not be compatible with other gems that patch ActiveRecord.

**ca_bundle_path**

| TypeString                               |
| ---------------------------------------- |
| Defaultnil                               |
| Environ variableNEW_RELIC_CA_BUNDLE_PATH |

Manual override for the path to your local CA bundle. This CA bundle validates the SSL certificate presented by New Relic's data collection service.

**capture_memcache_keys**

| TypeBoolean                                     |
| ----------------------------------------------- |
| Defaultfalse                                    |
| Environ variableNEW_RELIC_CAPTURE_MEMCACHE_KEYS |

If `true`, the agent captures memcache keys in transaction traces.

**capture_params**

| TypeBoolean                              |
| ---------------------------------------- |
| Defaultfalse                             |
| Environ variableNEW_RELIC_CAPTURE_PARAMS |

When `true`, the agent captures HTTP request parameters and attaches them to transaction traces, traced errors, and [`TransactionError` events](/attribute-dictionary?attribute_name=&events_tids%5B%5D=8241).
When using the capture_params setting, the Ruby agent will not attempt to filter secret information. Recommendation: To filter secret information from request parameters, use the attributes.include setting instead. For more information, see the Ruby attribute examples.

**clear_transaction_state_after_fork**

| TypeBoolean                                                  |
| ------------------------------------------------------------ |
| Defaultfalse                                                 |
| Environ variableNEW_RELIC_CLEAR_TRANSACTION_STATE_AFTER_FORK |

If `true`, the agent will clear `Tracer::State` in `Agent.drop_buffered_data`.

**config_path**

| TypeString                            |
| ------------------------------------- |
| Default(Dynamic)                      |
| Environ variableNEW_RELIC_CONFIG_PATH |

Path to `newrelic.yml`. If undefined, the agent checks the following directories (in order): `config/newrelic.yml` -> `newrelic.yml` -> `$HOME/.newrelic/newrelic.yml` -> `$HOME/newrelic.yml`

**exclude_newrelic_header**

| TypeBoolean                                       |
| ------------------------------------------------- |
| Defaultfalse                                      |
| Environ variableNEW_RELIC_EXCLUDE_NEWRELIC_HEADER |

If `true`, suppresses the `newrelic` distributed tracing header on outbound requests.

**force_install_exit_handler**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaultfalse                                         |
| Environ variableNEW_RELIC_FORCE_INSTALL_EXIT_HANDLER |

If `true`, forces the agent to install its exit handler (which sends all cached data to the collector before shutting down), even in cases where the agent would normally skip it, such as when it detects Sinatra running as an embedded service within another framework. Sinatra runs the entire application inside its own `at_exit` block, so the agent skips its own `at_exit` handler by default to avoid conflicts. This setting overrides that. Note: `send_data_on_exit` must also be `true` for this setting to have any effect.

**high_security**

| TypeBoolean                             |
| --------------------------------------- |
| Defaultfalse                            |
| Environ variableNEW_RELIC_HIGH_SECURITY |

If `true`, enables [high security mode](https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security). Ensure you understand the implications of high security mode before enabling this setting.

**labels**

| TypeString                       |
| -------------------------------- |
| Default""                        |
| Environ variableNEW_RELIC_LABELS |

A dictionary of [label names](https://docs.newrelic.com/docs/data-analysis/user-interface-functions/labels-categories-organize-your-apps-servers) and values that will be applied to the data sent from this agent. May also be expressed as a semicolon-delimited `;` string of colon-separated `:` pairs. For example, `Server:One;Data Center:Primary`.

**log_file_name**

| TypeString                              |
| --------------------------------------- |
| Default"newrelic_agent.log"             |
| Environ variableNEW_RELIC_LOG_FILE_NAME |

Defines a name for the log file.

**log_file_path**

| TypeString                              |
| --------------------------------------- |
| Default"log/"                           |
| Environ variableNEW_RELIC_LOG_FILE_PATH |

Defines a path to the agent log file, excluding the filename. If you want to send your agent logs to standard out, set this to `STDOUT`.

**marshaller**

| TypeString                           |
| ------------------------------------ |
| Default"json"                        |
| Environ variableNEW_RELIC_MARSHALLER |

Specifies a marshaller for transmitting data to the New Relic [collector](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/glossary#collector). Currently `json` is the only valid value for this setting.

**monitor_mode**

| TypeBoolean                            |
| -------------------------------------- |
| Defaulttrue                            |
| Environ variableNEW_RELIC_MONITOR_MODE |

When `true`, the agent transmits data about your app to the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector).

**prepend_active_record_instrumentation**

| TypeBoolean                                                     |
| --------------------------------------------------------------- |
| Defaultfalse                                                    |
| Environ variableNEW_RELIC_PREPEND_ACTIVE_RECORD_INSTRUMENTATION |

If `true`, uses `Module#prepend` rather than `alias_method` for ActiveRecord instrumentation.

**proxy_host**

| TypeString                           |
| ------------------------------------ |
| Defaultnil                           |
| Environ variableNEW_RELIC_PROXY_HOST |

Defines a host for communicating with the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector) via a proxy server.

**proxy_pass**

| TypeString                           |
| ------------------------------------ |
| Defaultnil                           |
| Environ variableNEW_RELIC_PROXY_PASS |

Defines a password for communicating with the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector) via a proxy server.

**proxy_port**

| TypeInteger                          |
| ------------------------------------ |
| Default8080                          |
| Environ variableNEW_RELIC_PROXY_PORT |

Defines a port for communicating with the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector) via a proxy server.

**proxy_user**

| TypeString                           |
| ------------------------------------ |
| Defaultnil                           |
| Environ variableNEW_RELIC_PROXY_USER |

Defines a user for communicating with the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector) via a proxy server.

**send_data_on_exit**

| TypeBoolean                                 |
| ------------------------------------------- |
| Defaulttrue                                 |
| Environ variableNEW_RELIC_SEND_DATA_ON_EXIT |

If `true`, enables the exit handler that sends data to the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector) before shutting down.

**sync_startup**

| TypeBoolean                            |
| -------------------------------------- |
| Defaultfalse                           |
| Environ variableNEW_RELIC_SYNC_STARTUP |

When set to `true`, forces a synchronous connection to the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector) during application startup. For very short-lived processes, this helps ensure the New Relic agent has time to report.

**thread_local_tracer_state**

| TypeBoolean                                         |
| --------------------------------------------------- |
| Defaultfalse                                        |
| Environ variableNEW_RELIC_THREAD_LOCAL_TRACER_STATE |

If `true`, tracer state storage is thread-local, otherwise, fiber-local.

**timeout**

| TypeInteger                       |
| --------------------------------- |
| Default120                        |
| Environ variableNEW_RELIC_TIMEOUT |

Defines the maximum number of seconds the agent should spend attempting to connect to the collector.

**allow_all_headers**

| TypeBoolean                                 |
| ------------------------------------------- |
| Defaultfalse                                |
| Environ variableNEW_RELIC_ALLOW_ALL_HEADERS |

If `true`, enables capture of all HTTP request headers for all destinations.

**automatic_custom_instrumentation_method_list**

| TypeArray                                                              |
| ---------------------------------------------------------------------- |
| Default\[]                                                             |
| Environ variableNEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST |

An array of `CLASS#METHOD` (for instance methods) and/or `CLASS.METHOD` (for class methods) strings representing Ruby methods that the agent can automatically add custom instrumentation to. This doesn't require any modifications of the source code that defines the methods.

Use fully qualified class names (using the `::` delimiter) that include any module or class namespacing.

Here is some Ruby source code that defines a `render_png` instance method for an `Image` class and a `notify` class method for a `User` class, both within a `MyCompany` module namespace:

````rb
		module MyCompany
			class Image
				def render_png
					# code to render a PNG
				end
			end

			class User
				def self.notify
					# code to notify users
				end
			end
		end
	```

	Given that source code, the `newrelic.yml` config file might request instrumentation for both of these methods like so:

	```yaml
		automatic_custom_instrumentation_method_list:
			- MyCompany::Image#render_png
			- MyCompany::User.notify
	```

	That configuration example uses YAML array syntax to specify both methods. Alternatively, you can use a comma-delimited string:

	```yaml
		automatic_custom_instrumentation_method_list: 'MyCompany::Image#render_png, MyCompany::User.notify'
	```

	Whitespace around the comma(s) in the list is optional. When configuring the agent with a list of methods via the `NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST` environment variable, use this comma-delimited string format:

	```sh
		export NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST='MyCompany::Image#render_png, MyCompany::User.notify'
	```

 
````

**simplify_action_cable_broadcast_metrics**

| TypeBoolean                                                       |
| ----------------------------------------------------------------- |
| Defaultfalse                                                      |
| Environ variableNEW_RELIC_SIMPLIFY_ACTION_CABLE_BROADCAST_METRICS |

If `true`, metrics for Action Cable broadcast calls will not include the `broadcasting` value for a given broadcast. Defaults to `false`. The default may change in a future major version release.

**ignored_middleware_classes**

| TypeArray                                            |
| ---------------------------------------------------- |
| Default\[]                                           |
| Environ variableNEW_RELIC_IGNORED_MIDDLEWARE_CLASSES |

A list of middleware class or module names the agent should ignore. Example: ["Rack::Cors", "ActionDispatch::Reloader"]

**defer_rails_initialization**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaultfalse                                         |
| Environ variableNEW_RELIC_DEFER_RAILS_INITIALIZATION |

If `true`, when the agent is in an application using Ruby on Rails, it will start after `config/initializers` run.
This option may only be set by environment variable.

## Transaction Tracer [#transaction-tracer]

The [transaction traces](https://docs.newrelic.com/docs/apm/traces/transaction-traces/transaction-traces) feature collects detailed information from a selection of transactions, including a summary of the calling sequence, a breakdown of time spent, and a list of SQL queries and their query plans (on mysql and postgresql). Available features depend on your New Relic subscription level.

**transaction_tracer.enabled**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaulttrue                                          |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_ENABLED |

If `true`, enables collection of [transaction traces](https://docs.newrelic.com/docs/apm/traces/transaction-traces/transaction-traces).

**transaction_tracer.explain_enabled**

| TypeBoolean                                                  |
| ------------------------------------------------------------ |
| Defaulttrue                                                  |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_EXPLAIN_ENABLED |

If `true`, enables the collection of explain plans in transaction traces. This setting will also apply to explain plans in slow SQL traces if [`slow_sql.explain_enabled`](#slow_sql-explain_enabled) isn't set separately.

**transaction_tracer.explain_threshold**

| TypeFloat                                                      |
| -------------------------------------------------------------- |
| Default0.5                                                     |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_EXPLAIN_THRESHOLD |

Threshold (in seconds) above which the agent will collect explain plans. Relevant only when [`explain_enabled`](#transaction_tracer.explain_enabled) is true.

**transaction_tracer.limit_segments**

| TypeInteger                                                 |
| ----------------------------------------------------------- |
| Default4000                                                 |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_LIMIT_SEGMENTS |

Maximum number of transaction trace nodes to record in a single transaction trace.

**transaction_tracer.record_redis_arguments**

| TypeBoolean                                                         |
| ------------------------------------------------------------------- |
| Defaultfalse                                                        |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_RECORD_REDIS_ARGUMENTS |

If `true`, the agent records Redis command arguments in transaction traces.

**transaction_tracer.record_sql**

| TypeString                                              |
| ------------------------------------------------------- |
| Default"obfuscated"                                     |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_RECORD_SQL |

Obfuscation level for SQL queries reported in transaction trace nodes. By default, this is set to `obfuscated`, which strips out the numeric and string literals.

-   If you do not want the agent to capture query information, set this to `none`.
-   If you want the agent to capture all query information in its original form, set this to `raw`.
-   When you enable [high security mode](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.

**transaction_tracer.stack_trace_threshold**

| TypeFloat                                                          |
| ------------------------------------------------------------------ |
| Default0.5                                                         |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_STACK_TRACE_THRESHOLD |

Specify a threshold in seconds. The agent includes stack traces in transaction trace nodes when the stack trace duration exceeds this threshold.

**transaction_tracer.cap_segment_artifacts**

| TypeBoolean                                                        |
| ------------------------------------------------------------------ |
| Defaultfalse                                                       |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_CAP_SEGMENT_ARTIFACTS |

If `true`, once [`transaction_tracer.limit_segments`](#transaction_tracer-limit_segments) is reached, the agent will also stop recording exclusive time for any segments created afterward in that transaction. This can reduce memory usage for very long-running transactions with many segments, at the cost of less accurate timing data for segments in the transaction if the segment limit is reached.

**transaction_tracer.transaction_threshold**

| TypeFloat                                                          |
| ------------------------------------------------------------------ |
| Default(Dynamic)                                                   |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_TRANSACTION_THRESHOLD |

Specify a threshold in seconds. Transactions with a duration longer than this threshold are eligible for transaction traces. Specify a float value or the string `apdex_f`.

## Error Collector [#error-collector]

The agent collects and reports all uncaught exceptions by default. These configuration options allow you to customize the error collection.

For information on ignored and expected errors, [see this page on Error Analytics in APM](https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected/). To set expected errors via the `NewRelic::Agent.notice_error` Ruby method, [consult the Ruby agent API](https://docs.newrelic.com/docs/agents/ruby-agent/api-guides/sending-handled-errors-new-relic/).

**error_collector.capture_events**

| TypeBoolean                                              |
| -------------------------------------------------------- |
| Defaulttrue                                              |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_CAPTURE_EVENTS |

If `true`, the agent collects [`TransactionError` events](https://docs.newrelic.com/docs/insights/new-relic-insights/decorating-events/error-event-default-attributes-insights).

**error_collector.enabled**

| TypeBoolean                                       |
| ------------------------------------------------- |
| Defaulttrue                                       |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_ENABLED |

If `true`, the agent captures traced errors and error count metrics.

**error_collector.expected_classes**

| TypeArray            |
| -------------------- |
| Default\[]           |
| Environ variableNone |

A list of error classes that the agent should treat as expected.
This option can't be set via environment variable.

**error_collector.expected_messages**

| TypeHash             |
| -------------------- |
| Default{}            |
| Environ variableNone |

A map of error classes to a list of messages. When an error of one of the classes specified here occurs, if its error message contains one of the strings corresponding to it here, that error will be treated as expected.
This option can't be set via environment variable.

**error_collector.expected_status_codes**

| TypeString                                                      |
| --------------------------------------------------------------- |
| Default""                                                       |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_EXPECTED_STATUS_CODES |

A comma-separated list of HTTP status codes and/or status code ranges (for example, `404, 429, 500-599`). Errors associated with a matching status code, if the error has one, will be treated as expected.

**error_collector.ignore_classes**

| TypeArray                                                       |
| --------------------------------------------------------------- |
| Default\["ActionController::RoutingError", "Sinatra::NotFound"] |
| Environ variableNone                                            |

A list of error classes that the agent should ignore.
This option can't be set via environment variable.

**error_collector.ignore_messages**

| TypeHash                               |
| -------------------------------------- |
| Default{ThreadError: \["queue empty"]} |
| Environ variableNone                   |

A map of error classes to a list of messages. When an error of one of the classes specified here occurs, if its error message contains one of the strings corresponding to it here, that error will be ignored.
This option can't be set via environment variable.

**error_collector.ignore_status_codes**

| TypeString                                                    |
| ------------------------------------------------------------- |
| Default""                                                     |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_IGNORE_STATUS_CODES |

A comma-separated list of HTTP status codes and/or status code ranges (for example, `404, 429, 500-599`). Errors associated with a matching status code, if the error has one, will be ignored.

**error_collector.max_backtrace_frames**

| TypeInteger                                                    |
| -------------------------------------------------------------- |
| Default50                                                      |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_MAX_BACKTRACE_FRAMES |

Defines the maximum number of frames in an error backtrace. Backtraces over this amount are truncated in the middle by default, preserving the beginning and the end of the stack trace. See [`error_collector.backtrace_truncate_location`](#error_collector-backtrace_truncate_location) to customize the truncation location.

**error_collector.backtrace_truncate_location**

| TypeString                                                            |
| --------------------------------------------------------------------- |
| Default"middle"                                                       |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_BACKTRACE_TRUNCATE_LOCATION |

Specifies where in the backtrace to truncate when the number of frames exceeds [`error_collector.max_backtrace_frames`](#error_collector-max_backtrace_frames). Options are `top` (remove frames from the beginning), `middle` (remove frames from the middle, preserving the beginning and end), or `end` (remove frames from the end).

**error_collector.max_event_samples_stored**

| TypeInteger                                                        |
| ------------------------------------------------------------------ |
| Default100                                                         |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_MAX_EVENT_SAMPLES_STORED |

Defines the maximum number of [`TransactionError` events](https://docs.newrelic.com/docs/insights/new-relic-insights/decorating-events/error-event-default-attributes-insights) reported per harvest cycle.

## Browser Monitoring [#browser-monitoring]

The browser monitoring [page load timing](https://docs.newrelic.com/docs/browser/new-relic-browser/page-load-timing/page-load-timing-process) feature (sometimes referred to as real user monitoring or RUM) gives you insight into the performance real users are experiencing with your website. This is accomplished by measuring the time it takes for your users' browsers to download and render your web pages by injecting a small amount of JavaScript code into the header and footer of each page.

**browser_monitoring.auto_instrument**

| TypeBoolean                                                  |
| ------------------------------------------------------------ |
| Defaulttrue                                                  |
| Environ variableNEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT |

If `true`, enables [auto-injection](https://docs.newrelic.com/docs/browser/new-relic-browser/installation-configuration/adding-apps-new-relic-browser#select-apm-app) of the JavaScript header for page load timing (sometimes referred to as real user monitoring or RUM).

**browser_monitoring.content_security_policy_nonce**

| TypeBoolean                                                                |
| -------------------------------------------------------------------------- |
| Defaulttrue                                                                |
| Environ variableNEW_RELIC_BROWSER_MONITORING_CONTENT_SECURITY_POLICY_NONCE |

If `true`, enables auto-injection of [Content Security Policy Nonce](https://content-security-policy.com/nonce/) in browser monitoring scripts. For now, auto-injection only works with Rails 5.2+.

**browser_monitoring.version**

| TypeString                                           |
| ---------------------------------------------------- |
| Default""                                            |
| Environ variableNEW_RELIC_BROWSER_MONITORING_VERSION |

Pin the version of the browser agent loader that New Relic injects, such as `1.317.0`. When unset, New Relic injects the latest available version. See the [browser agent EOL policy](https://docs.newrelic.com/docs/browser/browser-monitoring/getting-started/browser-agent-eol-policy/) for which versions are currently available and supported.

## Transaction Events [#transaction-events]

**transaction_events.enabled**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaulttrue                                          |
| Environ variableNEW_RELIC_TRANSACTION_EVENTS_ENABLED |

If `true`, enables transaction event sampling.

**transaction_events.max_samples_stored**

| TypeInteger                                                     |
| --------------------------------------------------------------- |
| Default1200                                                     |
| Environ variableNEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STORED |

Defines the maximum number of transaction events reported from a single harvest.

## Application Logging [#application-logging]

The Ruby agent supports [APM logs in context](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/get-started-logs-context). For some tips on configuring logs for the Ruby agent, see [Configure Ruby logs in context](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-ruby).

Available logging-related config options include:

**application_logging.enabled**

| TypeBoolean                                           |
| ----------------------------------------------------- |
| Defaulttrue                                           |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_ENABLED |

If `true`, enables log decoration and the collection of log events and metrics.

**application_logging.forwarding.enabled**

| TypeBoolean                                                      |
| ---------------------------------------------------------------- |
| Defaulttrue                                                      |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED |

If `true`, the agent captures log records emitted by your application.

**application_logging.forwarding.log_level**

| TypeString                                                         |
| ------------------------------------------------------------------ |
| Default"debug"                                                     |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_FORWARDING_LOG_LEVEL |

Sets the minimum level a log event must have to be forwarded to New Relic. Logs at the configured level and any higher severity are forwarded, for example, `debug` forwards all log events, while `error` forwards only `error`, `fatal`, and `unknown` events. Valid values, lowest to highest severity: `debug`, `info`, `warn`, `error`, `fatal`, `unknown` (case-insensitive).

This ordering is based on the integer values of Ruby's `Logger::Severity` constants (see <https://github.com/ruby/logger/blob/113b82a06b3076b93a71cd467e1605b23afb3088/lib/logger/severity.rb>).

**application_logging.forwarding.custom_attributes**

| TypeHash                                                                   |
| -------------------------------------------------------------------------- |
| Default{}                                                                  |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_FORWARDING_CUSTOM_ATTRIBUTES |

A hash with key/value pairs to add as custom attributes to all log events forwarded to New Relic. If sending using an environment variable, the value must be formatted like: "key1=value1,key2=value2"

**application_logging.forwarding.labels.enabled**

| TypeBoolean                                                             |
| ----------------------------------------------------------------------- |
| Defaultfalse                                                            |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_FORWARDING_LABELS_ENABLED |

If `true`, the agent attaches [labels](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#labels) to log records.

**application_logging.forwarding.labels.exclude**

| TypeArray                                                               |
| ----------------------------------------------------------------------- |
| Default\[]                                                              |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_FORWARDING_LABELS_EXCLUDE |

A case-insensitive array or comma-delimited string containing the labels to exclude from log records.

**application_logging.forwarding.max_samples_stored**

| TypeInteger                                                                 |
| --------------------------------------------------------------------------- |
| Default10000                                                                |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_FORWARDING_MAX_SAMPLES_STORED |

Defines the maximum number of log records to buffer in memory at a time.

**application_logging.local_decorating.enabled**

| TypeBoolean                                                            |
| ---------------------------------------------------------------------- |
| Defaultfalse                                                           |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_LOCAL_DECORATING_ENABLED |

If `true`, the agent decorates logs with metadata to link to entities, hosts, traces, and spans.

**application_logging.metrics.enabled**

| TypeBoolean                                                   |
| ------------------------------------------------------------- |
| Defaulttrue                                                   |
| Environ variableNEW_RELIC_APPLICATION_LOGGING_METRICS_ENABLED |

If `true`, the agent captures metrics related to logging for your application.

## AI Monitoring [#ai-monitoring]

This section includes Ruby agent configurations for setting up AI monitoring.

> #### ⚠️ IMPORTANT
>
> You need to enable distributed tracing to capture trace and feedback data. It is turned on by default in Ruby agents 8.0.0 and higher.

**ai_monitoring.enabled**

| TypeBoolean                                     |
| ----------------------------------------------- |
| Defaultfalse                                    |
| Environ variableNEW_RELIC_AI_MONITORING_ENABLED |

If `false`, all LLM instrumentation (OpenAI only for now) will be disabled and no metrics, events, or spans will be sent. AI Monitoring is automatically disabled if `high_security` mode is enabled.

**ai_monitoring.record_content.enabled**

| TypeBoolean                                                    |
| -------------------------------------------------------------- |
| Defaulttrue                                                    |
| Environ variableNEW_RELIC_AI_MONITORING_RECORD_CONTENT_ENABLED |

If `false`, LLM instrumentation (OpenAI only for now) will not capture the `content` attribute on LlmChatCompletionMessage events or the `input` attribute on LlmEmbedding events. This is an optional security setting to prevent recording sensitive data sent to and received from your LLMs.

## Attributes [#attributes]

[Attributes](https://docs.newrelic.com/docs/features/agent-attributes) are key-value pairs containing information that determines the properties of an event or transaction. These key-value pairs can be viewed within transaction traces in APM, traced errors in APM, transaction events in dashboards, and page views in dashboards. You can customize exactly which attributes will be sent to each of these destinations

**attributes.enabled**

| TypeBoolean                                  |
| -------------------------------------------- |
| Defaulttrue                                  |
| Environ variableNEW_RELIC_ATTRIBUTES_ENABLED |

If `true`, enables capture of attributes for all destinations.

**attributes.exclude**

| TypeArray                                    |
| -------------------------------------------- |
| Default\[]                                   |
| Environ variableNEW_RELIC_ATTRIBUTES_EXCLUDE |

Prefix of attributes to exclude from all destinations. Allows `*` as wildcard at end.

**attributes.include**

| TypeArray                                    |
| -------------------------------------------- |
| Default\[]                                   |
| Environ variableNEW_RELIC_ATTRIBUTES_INCLUDE |

Prefix of attributes to include in all destinations. Allows `*` as wildcard at end.

**browser_monitoring.attributes.enabled**

| TypeBoolean                                                     |
| --------------------------------------------------------------- |
| Defaultfalse                                                    |
| Environ variableNEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_ENABLED |

If `true`, the agent captures attributes from browser monitoring.

**browser_monitoring.attributes.exclude**

| TypeArray                                                       |
| --------------------------------------------------------------- |
| Default\[]                                                      |
| Environ variableNEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_EXCLUDE |

Prefix of attributes to exclude from browser monitoring. Allows `*` as wildcard at end.

**browser_monitoring.attributes.include**

| TypeArray                                                       |
| --------------------------------------------------------------- |
| Default\[]                                                      |
| Environ variableNEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_INCLUDE |

Prefix of attributes to include in browser monitoring. Allows `*` as wildcard at end.

**error_collector.attributes.enabled**

| TypeBoolean                                                  |
| ------------------------------------------------------------ |
| Defaulttrue                                                  |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_ENABLED |

If `true`, the agent captures attributes from error collection.

**error_collector.attributes.exclude**

| TypeArray                                                    |
| ------------------------------------------------------------ |
| Default\[]                                                   |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_EXCLUDE |

Prefix of attributes to exclude from error collection. Allows `*` as wildcard at end.

**error_collector.attributes.include**

| TypeArray                                                    |
| ------------------------------------------------------------ |
| Default\[]                                                   |
| Environ variableNEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_INCLUDE |

Prefix of attributes to include in error collection. Allows `*` as wildcard at end.

**span_events.attributes.enabled**

| TypeBoolean                                              |
| -------------------------------------------------------- |
| Defaulttrue                                              |
| Environ variableNEW_RELIC_SPAN_EVENTS_ATTRIBUTES_ENABLED |

If `true`, the agent captures attributes on span events.

**span_events.attributes.exclude**

| TypeArray                                                |
| -------------------------------------------------------- |
| Default\[]                                               |
| Environ variableNEW_RELIC_SPAN_EVENTS_ATTRIBUTES_EXCLUDE |

Prefix of attributes to exclude from span events. Allows `*` as wildcard at end.

**span_events.attributes.include**

| TypeArray                                                |
| -------------------------------------------------------- |
| Default\[]                                               |
| Environ variableNEW_RELIC_SPAN_EVENTS_ATTRIBUTES_INCLUDE |

Prefix of attributes to include on span events. Allows `*` as wildcard at end.

**transaction_events.attributes.enabled**

| TypeBoolean                                                     |
| --------------------------------------------------------------- |
| Defaulttrue                                                     |
| Environ variableNEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_ENABLED |

If `true`, the agent captures attributes from transaction events.

**transaction_events.attributes.exclude**

| TypeArray                                                       |
| --------------------------------------------------------------- |
| Default\[]                                                      |
| Environ variableNEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_EXCLUDE |

Prefix of attributes to exclude from transaction events. Allows `*` as wildcard at end.

**transaction_events.attributes.include**

| TypeArray                                                       |
| --------------------------------------------------------------- |
| Default\[]                                                      |
| Environ variableNEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_INCLUDE |

Prefix of attributes to include in transaction events. Allows `*` as wildcard at end.

**transaction_segments.attributes.enabled**

| TypeBoolean                                                       |
| ----------------------------------------------------------------- |
| Defaulttrue                                                       |
| Environ variableNEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_ENABLED |

If `true`, the agent captures attributes on transaction segments.

**transaction_segments.attributes.exclude**

| TypeArray                                                         |
| ----------------------------------------------------------------- |
| Default\[]                                                        |
| Environ variableNEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_EXCLUDE |

Prefix of attributes to exclude from transaction segments. Allows `*` as wildcard at end.

**transaction_segments.attributes.include**

| TypeArray                                                         |
| ----------------------------------------------------------------- |
| Default\[]                                                        |
| Environ variableNEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_INCLUDE |

Prefix of attributes to include on transaction segments. Allows `*` as wildcard at end.

**transaction_tracer.attributes.enabled**

| TypeBoolean                                                     |
| --------------------------------------------------------------- |
| Defaulttrue                                                     |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_ENABLED |

If `true`, the agent captures attributes from transaction traces.

**transaction_tracer.attributes.exclude**

| TypeArray                                                       |
| --------------------------------------------------------------- |
| Default\[]                                                      |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_EXCLUDE |

Prefix of attributes to exclude from transaction traces. Allows `*` as wildcard at end.

**transaction_tracer.attributes.include**

| TypeArray                                                       |
| --------------------------------------------------------------- |
| Default\[]                                                      |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_INCLUDE |

Prefix of attributes to include in transaction traces. Allows `*` as wildcard at end.

## Audit Log [#audit-log]

**audit_log.enabled**

| TypeBoolean                                 |
| ------------------------------------------- |
| Defaultfalse                                |
| Environ variableNEW_RELIC_AUDIT_LOG_ENABLED |

If `true`, enables an audit log which logs communications with the New Relic [collector](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/get-started/glossary/#collector).

**audit_log.endpoints**

| TypeArray                                     |
| --------------------------------------------- |
| Default\[".\*"]                               |
| Environ variableNEW_RELIC_AUDIT_LOG_ENDPOINTS |

List of allowed endpoints to include in the audit log.

**audit_log.path**

| TypeString                               |
| ---------------------------------------- |
| Defaultlog/newrelic_audit.log            |
| Environ variableNEW_RELIC_AUDIT_LOG_PATH |

Specifies a path to the audit log file (including the filename).

## Autostart [#autostart]

**autostart.denylisted_constants**

| TypeString                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Default"Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RoutesCommand,Rails::Command::RunnerCommand,Rails::Command::SecretsCommand,Rails::Command::TestCommand,Rails::Console,Rails::DBConsole" |
| Environ variableNEW_RELIC_AUTOSTART_DENYLISTED_CONSTANTS                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

Specify a list of constants that should prevent the agent from starting automatically. Separate individual constants with a comma `,`. For example, `"Rails::Console,UninstrumentedBackgroundJob"`.

**autostart.denylisted_executables**

| TypeString                                                 |
| ---------------------------------------------------------- |
| Default"irb,rspec"                                         |
| Environ variableNEW_RELIC_AUTOSTART_DENYLISTED_EXECUTABLES |

Defines a comma-delimited list of executables that the agent should not instrument. For example, `"rake,my_ruby_script.rb"`.

**autostart.denylisted_rake_tasks**

| TypeString                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Default"about,assets:clean,assets:clobber,assets:environment,assets:precompile,assets:precompile:all,db:create,db:drop,db:fixtures:load,db:migrate,db:migrate:status,db:rollback,db:schema:cache:clear,db:schema:cache:dump,db:schema:dump,db:schema:load,db:seed,db:setup,db:structure:dump,db:version,doc:app,log:clear,middleware,notes,notes:custom,rails:template,rails:update,routes,secret,spec,spec:features,spec:requests,spec:controllers,spec:helpers,spec:models,spec:views,spec:routing,spec:rcov,stats,test,test:all,test:all:db,test:recent,test:single,test:uncommitted,time:zones:all,tmp:clear,tmp:create,webpacker:compile" |
| Environ variableNEW_RELIC_AUTOSTART_DENYLISTED_RAKE_TASKS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

Defines a comma-delimited list of Rake tasks that the agent should not instrument. For example, `"assets:precompile,db:migrate"`.

## Cloud [#cloud]

**cloud.aws.account_id**

| TypeString                                     |
| ---------------------------------------------- |
| Defaultnil                                     |
| Environ variableNEW_RELIC_CLOUD_AWS_ACCOUNT_ID |

The AWS account ID associated with this application.

## Code Level Metrics [#code-level-metrics]

**code_level_metrics.enabled**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaulttrue                                          |
| Environ variableNEW_RELIC_CODE_LEVEL_METRICS_ENABLED |

If `true`, the agent will report source code level metrics for traced methods.
See: <https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration/>

## Custom Attributes [#custom-attributes]

**custom_attributes.enabled**

| TypeBoolean                                         |
| --------------------------------------------------- |
| Defaulttrue                                         |
| Environ variableNEW_RELIC_CUSTOM_ATTRIBUTES_ENABLED |

If `false`, custom attributes will not be sent on events.

## Custom Events [#custom-events]

**custom_insights_events.enabled**

| TypeBoolean                                              |
| -------------------------------------------------------- |
| Defaulttrue                                              |
| Environ variableNEW_RELIC_CUSTOM_INSIGHTS_EVENTS_ENABLED |

If `true`, the agent captures [custom events](https://docs.newrelic.com/docs/insights/new-relic-insights/adding-querying-data/inserting-custom-events-new-relic-apm-agents).

**custom_insights_events.max_samples_stored**

| TypeInteger                                                         |
| ------------------------------------------------------------------- |
| Default3000                                                         |
| Environ variableNEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED |

Specify a maximum number of custom events to buffer in memory at a time. When configuring the agent for [AI monitoring](https://docs.newrelic.com/docs/ai-monitoring/intro-to-ai-monitoring), set to max value `100000`. This ensures the agent captures the maximum amount of LLM events.

## Datastore Tracer [#datastore-tracer]

**datastore_tracer.database_name_reporting.enabled**

| TypeBoolean                                                                |
| -------------------------------------------------------------------------- |
| Defaulttrue                                                                |
| Environ variableNEW_RELIC_DATASTORE_TRACER_DATABASE_NAME_REPORTING_ENABLED |

If `false`, the agent will not add `database_name` parameter to transaction or slow SQL traces.

**datastore_tracer.instance_reporting.enabled**

| TypeBoolean                                                           |
| --------------------------------------------------------------------- |
| Defaulttrue                                                           |
| Environ variableNEW_RELIC_DATASTORE_TRACER_INSTANCE_REPORTING_ENABLED |

If `false`, the agent will not report datastore instance metrics, nor add `host` or `port_path_or_id` parameters to transaction or slow SQL traces.

## Disabling [#disabling]

Use these settings to toggle instrumentation types during agent startup.

**disable_action_cable_instrumentation**

| TypeBoolean                                                    |
| -------------------------------------------------------------- |
| Defaultfalse                                                   |
| Environ variableNEW_RELIC_DISABLE_ACTION_CABLE_INSTRUMENTATION |

If `true`, disables Action Cable instrumentation.

**disable_action_controller**

| TypeBoolean                                         |
| --------------------------------------------------- |
| Defaultfalse                                        |
| Environ variableNEW_RELIC_DISABLE_ACTION_CONTROLLER |

If `true`, disables Action Controller instrumentation.

**disable_action_mailbox**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaultfalse                                     |
| Environ variableNEW_RELIC_DISABLE_ACTION_MAILBOX |

If `true`, disables Action Mailbox instrumentation.

**disable_action_mailer**

| TypeBoolean                                     |
| ----------------------------------------------- |
| Defaultfalse                                    |
| Environ variableNEW_RELIC_DISABLE_ACTION_MAILER |

If `true`, disables Action Mailer instrumentation.

**disable_activejob**

| TypeBoolean                                 |
| ------------------------------------------- |
| Defaultfalse                                |
| Environ variableNEW_RELIC_DISABLE_ACTIVEJOB |

If `true`, disables Active Job instrumentation.

**disable_active_job_step_names**

| TypeBoolean                                             |
| ------------------------------------------------------- |
| Defaultfalse                                            |
| Environ variableNEW_RELIC_DISABLE_ACTIVE_JOB_STEP_NAMES |

If `true`, step names from Rails Active Job Continuations will not be included in metric names. This reduces metric cardinality but also reduces visibility into individual step performance. Only set this to `true` if you are experiencing metric cardinality issues due to jobs with many steps or dynamically-named steps.

**disable_active_storage**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaultfalse                                     |
| Environ variableNEW_RELIC_DISABLE_ACTIVE_STORAGE |

If `true`, disables Active Storage instrumentation.

**disable_active_support**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaultfalse                                     |
| Environ variableNEW_RELIC_DISABLE_ACTIVE_SUPPORT |

If `true`, disables Active Support instrumentation.

**disable_active_record_instrumentation**

| TypeBoolean                                                     |
| --------------------------------------------------------------- |
| Defaultfalse                                                    |
| Environ variableNEW_RELIC_DISABLE_ACTIVE_RECORD_INSTRUMENTATION |

If `true`, disables Active Record instrumentation.

**disable_active_record_notifications**

| TypeBoolean                                                   |
| ------------------------------------------------------------- |
| Defaultfalse                                                  |
| Environ variableNEW_RELIC_DISABLE_ACTIVE_RECORD_NOTIFICATIONS |

If `true`, disables instrumentation for Active Record 4+.

**disable_cpu_sampler**

| TypeBoolean                                   |
| --------------------------------------------- |
| Defaultfalse                                  |
| Environ variableNEW_RELIC_DISABLE_CPU_SAMPLER |

If `true`, the agent won't sample the CPU usage of the host process.

**disable_delayed_job_sampler**

| TypeBoolean                                           |
| ----------------------------------------------------- |
| Defaultfalse                                          |
| Environ variableNEW_RELIC_DISABLE_DELAYED_JOB_SAMPLER |

If `true`, the agent won't measure the depth of Delayed Job queues.

**disable_gc_profiler**

| TypeBoolean                                   |
| --------------------------------------------- |
| Defaultfalse                                  |
| Environ variableNEW_RELIC_DISABLE_GC_PROFILER |

If `true`, disables the use of `GC::Profiler` to measure time spent in garbage collection.

**disable_memory_sampler**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaultfalse                                     |
| Environ variableNEW_RELIC_DISABLE_MEMORY_SAMPLER |

If `true`, the agent won't sample the memory usage of the host process.

**disable_middleware_instrumentation**

| TypeBoolean                                                  |
| ------------------------------------------------------------ |
| Defaultfalse                                                 |
| Environ variableNEW_RELIC_DISABLE_MIDDLEWARE_INSTRUMENTATION |

If `true`, the agent won't wrap third-party middlewares in instrumentation (regardless of whether they are installed via `Rack::Builder` or Rails).
When middleware instrumentation is disabled, if an application is using middleware that could alter the response code, the HTTP status code reported on the transaction may not reflect the altered value.

**disable_samplers**

| TypeBoolean                                |
| ------------------------------------------ |
| Defaultfalse                               |
| Environ variableNEW_RELIC_DISABLE_SAMPLERS |

If `true`, disables the collection of sampler metrics. Sampler metrics are metrics that are not event-based (such as CPU time or memory usage).

**disable_sequel_instrumentation**

| TypeBoolean                                              |
| -------------------------------------------------------- |
| Defaultfalse                                             |
| Environ variableNEW_RELIC_DISABLE_SEQUEL_INSTRUMENTATION |

If `true`, disables [Sequel instrumentation](https://docs.newrelic.com/docs/agents/ruby-agent/frameworks/sequel-instrumentation).

**disable_sidekiq**

| TypeBoolean                               |
| ----------------------------------------- |
| Defaultfalse                              |
| Environ variableNEW_RELIC_DISABLE_SIDEKIQ |

If `true`, disables [Sidekiq instrumentation](https://docs.newrelic.com/docs/agents/ruby-agent/background-jobs/sidekiq-instrumentation).

**disable_roda_auto_middleware**

| TypeBoolean                                            |
| ------------------------------------------------------ |
| Defaultfalse                                           |
| Environ variableNEW_RELIC_DISABLE_RODA_AUTO_MIDDLEWARE |

If `true`, disables agent middleware for Roda. This middleware is responsible for advanced feature support such as [page load timing](https://docs.newrelic.com/docs/browser/new-relic-browser/getting-started/new-relic-browser) and [error collection](https://docs.newrelic.com/docs/apm/applications-menu/events/view-apm-error-analytics).

**disable_sinatra_auto_middleware**

| TypeBoolean                                               |
| --------------------------------------------------------- |
| Defaultfalse                                              |
| Environ variableNEW_RELIC_DISABLE_SINATRA_AUTO_MIDDLEWARE |

If `true`, disables agent middleware for Sinatra. This middleware is responsible for advanced feature support such as [distributed tracing](https://docs.newrelic.com/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing), [page load timing](https://docs.newrelic.com/docs/browser/new-relic-browser/getting-started/new-relic-browser), and [error collection](https://docs.newrelic.com/docs/apm/applications-menu/events/view-apm-error-analytics).

**disable_view_instrumentation**

| TypeBoolean                                            |
| ------------------------------------------------------ |
| Defaultfalse                                           |
| Environ variableNEW_RELIC_DISABLE_VIEW_INSTRUMENTATION |

If `true`, disables view instrumentation.

**disable_vm_sampler**

| TypeBoolean                                  |
| -------------------------------------------- |
| Defaultfalse                                 |
| Environ variableNEW_RELIC_DISABLE_VM_SAMPLER |

If `true`, the agent won't [sample performance measurements from the Ruby VM](https://docs.newrelic.com/docs/agents/ruby-agent/features/ruby-vm-measurements).

**disable_puma_instrumentation**

| TypeBoolean                                            |
| ------------------------------------------------------ |
| Defaulttrue                                            |
| Environ variableNEW_RELIC_DISABLE_PUMA_INSTRUMENTATION |

If `true`, disables the Puma server-statistics instrumentation that samples `Ruby/Puma/*` metrics from the Puma master process. This instrumentation is disabled by default. When enabled, the agent starts a reporting thread in the Puma master process to deliver these metrics.

## Distributed Tracing [#distributed-tracing]

**distributed_tracing.enabled**

| TypeBoolean                                           |
| ----------------------------------------------------- |
| Defaulttrue                                           |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_ENABLED |

Distributed tracing lets you see the path that a request takes through your distributed system. Enabling distributed tracing changes the behavior of some New Relic features, so carefully consult the [transition guide](https://docs.newrelic.com/docs/transition-guide-distributed-tracing) before you enable this feature.

**distributed_tracing.sampler.root**

| TypeString                                                 |
| ---------------------------------------------------------- |
| Default"adaptive"                                          |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT |

This setting controls the behavior of transaction sampling for transactions without a remote parent (traces that originate within this instance of the New Relic agent). Available values are `adaptive` (the default), `always_on`, `always_off`, and `trace_id_ratio_based`.

**distributed_tracing.sampler.remote_parent_sampled**

| TypeString                                                                  |
| --------------------------------------------------------------------------- |
| Default"adaptive"                                                           |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_SAMPLED |

This setting controls the behavior of transaction sampling when a remote parent is sampled. Available values are `adaptive` (the default), `always_on`, `always_off`, and `trace_id_ratio_based`.

**distributed_tracing.sampler.remote_parent_not_sampled**

| TypeString                                                                      |
| ------------------------------------------------------------------------------- |
| Default"adaptive"                                                               |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_NOT_SAMPLED |

This setting controls the behavior of transaction sampling when a remote parent is not sampled. Available values are `adaptive` (the default), `always_on`, `always_off`, and `trace_id_ratio_based`.

## Elasticsearch [#elasticsearch]

**elasticsearch.capture_cluster_name**

| TypeBoolean                                                  |
| ------------------------------------------------------------ |
| Defaulttrue                                                  |
| Environ variableNEW_RELIC_ELASTICSEARCH_CAPTURE_CLUSTER_NAME |

If `true`, the agent captures the Elasticsearch cluster name in transaction traces.

**elasticsearch.capture_queries**

| TypeBoolean                                             |
| ------------------------------------------------------- |
| Defaulttrue                                             |
| Environ variableNEW_RELIC_ELASTICSEARCH_CAPTURE_QUERIES |

If `true`, the agent captures Elasticsearch queries in transaction traces.

**elasticsearch.obfuscate_queries**

| TypeBoolean                                               |
| --------------------------------------------------------- |
| Defaulttrue                                               |
| Environ variableNEW_RELIC_ELASTICSEARCH_OBFUSCATE_QUERIES |

If `true`, the agent obfuscates Elasticsearch queries in transaction traces.

## Heroku [#heroku]

**heroku.use_dyno_names**

| TypeBoolean                                     |
| ----------------------------------------------- |
| Defaulttrue                                     |
| Environ variableNEW_RELIC_HEROKU_USE_DYNO_NAMES |

If `true`, the agent uses Heroku dyno names as the hostname.

**heroku.dyno_name_prefixes_to_shorten**

| TypeArray                                                      |
| -------------------------------------------------------------- |
| Default\["scheduler", "run"]                                   |
| Environ variableNEW_RELIC_HEROKU_DYNO_NAME_PREFIXES_TO_SHORTEN |

Ordinarily the agent reports dyno names with a trailing dot and process ID (for example, `worker.3`). You can remove this trailing data by specifying the prefixes you want to report without trailing data (for example, `worker`).

## Infinite Tracing [#infinite-tracing]

**infinite_tracing.trace_observer.host**

| TypeString                                                     |
| -------------------------------------------------------------- |
| Default""                                                      |
| Environ variableNEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_HOST |

Configures the hostname for the trace observer Host. When configured, enables tail-based sampling by sending all recorded spans to a trace observer for further sampling decisions, irrespective of any usual agent sampling decision.

**infinite_tracing.trace_observer.port**

| TypeInteger                                                    |
| -------------------------------------------------------------- |
| Default443                                                     |
| Environ variableNEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_PORT |

Configures the TCP/IP port for the trace observer Host

**infinite_tracing.batching**

| TypeBoolean                                         |
| --------------------------------------------------- |
| Defaulttrue                                         |
| Environ variableNEW_RELIC_INFINITE_TRACING_BATCHING |

If `true` (the default), data sent to the trace observer is batched instead of sending each span individually.

**infinite_tracing.compression_level**

| TypeSymbol                                                   |
| ------------------------------------------------------------ |
| Default:high                                                 |
| Environ variableNEW_RELIC_INFINITE_TRACING_COMPRESSION_LEVEL |

Configure the compression level for data sent to the trace observer. May be one of: `:none`, `:low`, `:medium`, `:high`. Set the level to `:none` to disable compression.

## Instrumentation [#instrumentation]

**instrumentation.active_support_notifications.active_support_events**

| TypeArray                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Default\["cache_fetch_hit.active_support", "cache_generate.active_support", "cache_read.active_support", "cache_write.active_support", "cache_delete.active_support", "cache_exist?.active_support", "cache_read_multi.active_support", "cache_write_multi.active_support", "cache_delete_multi.active_support", "cache_delete_matched.active_support", "cache_cleanup.active_support", "cache_increment.active_support", "cache_decrement.active_support", "cache_prune.active_support", "message_serializer_fallback.active_support"] |
| Environ variableNEW_RELIC_INSTRUMENTATION_ACTIVE_SUPPORT_NOTIFICATIONS_ACTIVE_SUPPORT_EVENTS                                                                                                                                                                                                                                                                                                                                                                                                                                            |

An allowlist of ActiveSupport notification event names (mostly caching events and message-serializer events) that the agent subscribes to. Any event name not included here is ignored. Provide complete event names only, such as `cache_fetch_hit.active_support`. Do not provide asterisks or regex patterns, and do not escape any characters with backslashes.

For the complete list of possible event names, see the Rails documentation's list of [caching names](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#active-support-caching) and [messages names](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#active-support-messages).

**instrumentation.active_support_broadcast_logger**

| TypeString                                                                |
| ------------------------------------------------------------------------- |
| Defaultauto                                                               |
| Environ variableNEW_RELIC_INSTRUMENTATION_ACTIVE_SUPPORT_BROADCAST_LOGGER |

Controls auto-instrumentation of `ActiveSupport::BroadcastLogger` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`. Used in Rails versions >= 7.1.

**instrumentation.active_support_logger**

| TypeString                                                      |
| --------------------------------------------------------------- |
| Defaultauto                                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_ACTIVE_SUPPORT_LOGGER |

Controls auto-instrumentation of `ActiveSupport::Logger` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`. Used in Rails versions below 7.1.

**instrumentation.async_http**

| TypeString                                           |
| ---------------------------------------------------- |
| Defaultauto                                          |
| Environ variableNEW_RELIC_INSTRUMENTATION_ASYNC_HTTP |

Controls auto-instrumentation of Async::HTTP at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.bunny**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultauto                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_BUNNY |

Controls auto-instrumentation of bunny at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.semantic_logger**

| TypeString                                                |
| --------------------------------------------------------- |
| Defaultauto                                               |
| Environ variableNEW_RELIC_INSTRUMENTATION_SEMANTIC_LOGGER |

Controls auto-instrumentation of the semantic_logger library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.parallel**

| TypeString                                         |
| -------------------------------------------------- |
| Defaultauto                                        |
| Environ variableNEW_RELIC_INSTRUMENTATION_PARALLEL |

Controls auto-instrumentation of the parallel library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.aws_sdk_firehose**

| TypeString                                                 |
| ---------------------------------------------------------- |
| Defaultauto                                                |
| Environ variableNEW_RELIC_INSTRUMENTATION_AWS_SDK_FIREHOSE |

Controls auto-instrumentation of the aws-sdk-firehose library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.aws_sdk_lambda**

| TypeString                                               |
| -------------------------------------------------------- |
| Defaultauto                                              |
| Environ variableNEW_RELIC_INSTRUMENTATION_AWS_SDK_LAMBDA |

Controls auto-instrumentation of the aws_sdk_lambda library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.aws_sdk_kinesis**

| TypeString                                                |
| --------------------------------------------------------- |
| Defaultauto                                               |
| Environ variableNEW_RELIC_INSTRUMENTATION_AWS_SDK_KINESIS |

Controls auto-instrumentation of the aws-sdk-kinesis library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.ruby_kafka**

| TypeString                                           |
| ---------------------------------------------------- |
| Default"auto"                                        |
| Environ variableNEW_RELIC_INSTRUMENTATION_RUBY_KAFKA |

Controls auto-instrumentation of the ruby-kafka library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.opensearch**

| TypeString                                           |
| ---------------------------------------------------- |
| Defaultauto                                          |
| Environ variableNEW_RELIC_INSTRUMENTATION_OPENSEARCH |

Controls auto-instrumentation of the opensearch-ruby library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.rdkafka**

| TypeString                                        |
| ------------------------------------------------- |
| Default"auto"                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_RDKAFKA |

Controls auto-instrumentation of the rdkafka library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.aws_sqs**

| TypeString                                        |
| ------------------------------------------------- |
| Default"auto"                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_AWS_SQS |

Controls auto-instrumentation of the aws-sdk-sqs library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.dynamodb**

| TypeString                                         |
| -------------------------------------------------- |
| Defaultauto                                        |
| Environ variableNEW_RELIC_INSTRUMENTATION_DYNAMODB |

Controls auto-instrumentation of the aws-sdk-dynamodb library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.fiber**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultauto                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_FIBER |

Controls auto-instrumentation of the Fiber class at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.concurrent_ruby**

| TypeString                                                |
| --------------------------------------------------------- |
| Defaultauto                                               |
| Environ variableNEW_RELIC_INSTRUMENTATION_CONCURRENT_RUBY |

Controls auto-instrumentation of the concurrent-ruby library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.curb**

| TypeString                                     |
| ---------------------------------------------- |
| Defaultauto                                    |
| Environ variableNEW_RELIC_INSTRUMENTATION_CURB |

Controls auto-instrumentation of Curb at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.delayed_job**

| TypeString                                            |
| ----------------------------------------------------- |
| Defaultauto                                           |
| Environ variableNEW_RELIC_INSTRUMENTATION_DELAYED_JOB |

Controls auto-instrumentation of Delayed Job at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.elasticsearch**

| TypeString                                              |
| ------------------------------------------------------- |
| Defaultauto                                             |
| Environ variableNEW_RELIC_INSTRUMENTATION_ELASTICSEARCH |

Controls auto-instrumentation of the elasticsearch library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.ethon**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultauto                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_ETHON |

Controls auto-instrumentation of ethon at start up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.excon**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultenabled                                  |
| Environ variableNEW_RELIC_INSTRUMENTATION_EXCON |

Controls auto-instrumentation of Excon at start-up. May be one of: `enabled`, `disabled`.

**instrumentation.grape**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultauto                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_GRAPE |

Controls auto-instrumentation of Grape at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.grpc_client**

| TypeString                                            |
| ----------------------------------------------------- |
| Defaultauto                                           |
| Environ variableNEW_RELIC_INSTRUMENTATION_GRPC_CLIENT |

Controls auto-instrumentation of gRPC clients at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.grpc.host_denylist**

| TypeArray                                                    |
| ------------------------------------------------------------ |
| Default\[]                                                   |
| Environ variableNEW_RELIC_INSTRUMENTATION_GRPC_HOST_DENYLIST |

A comma-separated list of regular expression patterns matching gRPC hostnames whose traffic New Relic should ignore. New Relic's gRPC client instrumentation skips tracing calls made to a host matching any of these patterns, and its gRPC server instrumentation skips tracing requests received by a server running on a matching host. For example, `"private.com$,exception.*" Empty by default, meaning no traffic is ignored.`.

**instrumentation.grpc_server**

| TypeString                                            |
| ----------------------------------------------------- |
| Defaultauto                                           |
| Environ variableNEW_RELIC_INSTRUMENTATION_GRPC_SERVER |

Controls auto-instrumentation of gRPC servers at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.httpclient**

| TypeString                                           |
| ---------------------------------------------------- |
| Defaultauto                                          |
| Environ variableNEW_RELIC_INSTRUMENTATION_HTTPCLIENT |

Controls auto-instrumentation of HTTPClient at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.httprb**

| TypeString                                       |
| ------------------------------------------------ |
| Defaultauto                                      |
| Environ variableNEW_RELIC_INSTRUMENTATION_HTTPRB |

Controls auto-instrumentation of http.rb gem at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.httpx**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultauto                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_HTTPX |

Controls auto-instrumentation of httpx at start up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.logger**

| TypeString                                       |
| ------------------------------------------------ |
| Defaultauto                                      |
| Environ variableNEW_RELIC_INSTRUMENTATION_LOGGER |

Controls auto-instrumentation of Ruby standard library Logger at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.logging**

| TypeString                                        |
| ------------------------------------------------- |
| Defaultauto                                       |
| Environ variableNEW_RELIC_INSTRUMENTATION_LOGGING |

Controls auto-instrumentation of the logging library at start-up. May be one of `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.logstasher**

| TypeString                                           |
| ---------------------------------------------------- |
| Defaultauto                                          |
| Environ variableNEW_RELIC_INSTRUMENTATION_LOGSTASHER |

Controls auto-instrumentation of the LogStasher library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.rails_event_logger**

| TypeString                                                   |
| ------------------------------------------------------------ |
| Defaultenabled                                               |
| Environ variableNEW_RELIC_INSTRUMENTATION_RAILS_EVENT_LOGGER |

Controls instrumentation of Rails.event as structured logs. May be one of: `enabled`, `disabled`.

**instrumentation.rails_event_logger.event_names**

| TypeArray                                                                |
| ------------------------------------------------------------------------ |
| Default\[]                                                               |
| Environ variableNEW_RELIC_INSTRUMENTATION_RAILS_EVENT_LOGGER_EVENT_NAMES |

An array of `Rails.event` names to capture as structured log events. For example: [user.signup, payment.processed, order.created]. Leave empty to capture all `Rails.event` notifications. Events are logged with level `UNKNOWN` (ensuring they're never filtered) unless overridden via a `:level` key in the event payload.

**instrumentation.memcache**

| TypeString                                         |
| -------------------------------------------------- |
| Defaultauto                                        |
| Environ variableNEW_RELIC_INSTRUMENTATION_MEMCACHE |

Controls auto-instrumentation of dalli gem for Memcache at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.memcached**

| TypeString                                          |
| --------------------------------------------------- |
| Defaultauto                                         |
| Environ variableNEW_RELIC_INSTRUMENTATION_MEMCACHED |

Controls auto-instrumentation of memcached gem for Memcache at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.memcache_client**

| TypeString                                                |
| --------------------------------------------------------- |
| Defaultauto                                               |
| Environ variableNEW_RELIC_INSTRUMENTATION_MEMCACHE_CLIENT |

Controls auto-instrumentation of memcache-client gem for Memcache at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.mongo**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultenabled                                  |
| Environ variableNEW_RELIC_INSTRUMENTATION_MONGO |

Controls auto-instrumentation of Mongo at start-up. May be one of: `enabled`, `disabled`.

**instrumentation.net_http**

| TypeString                                         |
| -------------------------------------------------- |
| Defaultauto                                        |
| Environ variableNEW_RELIC_INSTRUMENTATION_NET_HTTP |

Controls auto-instrumentation of `Net::HTTP` at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.ruby_openai**

| TypeString                                            |
| ----------------------------------------------------- |
| Defaultauto                                           |
| Environ variableNEW_RELIC_INSTRUMENTATION_RUBY_OPENAI |

Controls auto-instrumentation of the ruby-openai gem at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`. Defaults to `disabled` in high security mode.

**instrumentation.puma_rack**

| TypeString                                          |
| --------------------------------------------------- |
| Defaultauto                                         |
| Environ variableNEW_RELIC_INSTRUMENTATION_PUMA_RACK |

Controls auto-instrumentation of `Puma::Rack`. When enabled, the agent hooks into the `to_app` method in `Puma::Rack::Builder` to find gems to instrument during application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.puma_rack_urlmap**

| TypeString                                                 |
| ---------------------------------------------------------- |
| Defaultauto                                                |
| Environ variableNEW_RELIC_INSTRUMENTATION_PUMA_RACK_URLMAP |

Controls auto-instrumentation of `Puma::Rack::URLMap` at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.rack**

| TypeString                                     |
| ---------------------------------------------- |
| Defaultauto                                    |
| Environ variableNEW_RELIC_INSTRUMENTATION_RACK |

Controls auto-instrumentation of Rack. When enabled, the agent hooks into the `to_app` method in `Rack::Builder` to find gems to instrument during application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.rack_urlmap**

| TypeString                                            |
| ----------------------------------------------------- |
| Defaultauto                                           |
| Environ variableNEW_RELIC_INSTRUMENTATION_RACK_URLMAP |

Controls auto-instrumentation of `Rack::URLMap` at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.rake**

| TypeString                                     |
| ---------------------------------------------- |
| Defaultauto                                    |
| Environ variableNEW_RELIC_INSTRUMENTATION_RAKE |

Controls auto-instrumentation of rake at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.redis**

| TypeString                                      |
| ----------------------------------------------- |
| Defaultauto                                     |
| Environ variableNEW_RELIC_INSTRUMENTATION_REDIS |

Controls auto-instrumentation of Redis at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.resque**

| TypeString                                       |
| ------------------------------------------------ |
| Defaultauto                                      |
| Environ variableNEW_RELIC_INSTRUMENTATION_RESQUE |

Controls auto-instrumentation of resque at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.roda**

| TypeString                                     |
| ---------------------------------------------- |
| Defaultauto                                    |
| Environ variableNEW_RELIC_INSTRUMENTATION_RODA |

Controls auto-instrumentation of Roda at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.sinatra**

| TypeString                                        |
| ------------------------------------------------- |
| Defaultauto                                       |
| Environ variableNEW_RELIC_INSTRUMENTATION_SINATRA |

Controls auto-instrumentation of Sinatra at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.stripe**

| TypeString                                       |
| ------------------------------------------------ |
| Default"enabled"                                 |
| Environ variableNEW_RELIC_INSTRUMENTATION_STRIPE |

Controls auto-instrumentation of Stripe at startup. May be one of: `enabled`, `disabled`.

**instrumentation.view_component**

| TypeString                                               |
| -------------------------------------------------------- |
| Defaultauto                                              |
| Environ variableNEW_RELIC_INSTRUMENTATION_VIEW_COMPONENT |

Controls auto-instrumentation of ViewComponent at startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.thread**

| TypeString                                       |
| ------------------------------------------------ |
| Defaultauto                                      |
| Environ variableNEW_RELIC_INSTRUMENTATION_THREAD |

Controls auto-instrumentation of the Thread class at start-up to allow the agent to correctly nest spans inside of an asynchronous transaction. This does not enable the agent to automatically trace all threads created (see `instrumentation.thread.tracing`). May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.thread.tracing**

| TypeBoolean                                              |
| -------------------------------------------------------- |
| Defaulttrue                                              |
| Environ variableNEW_RELIC_INSTRUMENTATION_THREAD_TRACING |

Controls auto-instrumentation of the Thread class at start-up to automatically add tracing to all Threads created in the application.

**instrumentation.tilt**

| TypeString                                     |
| ---------------------------------------------- |
| Defaultauto                                    |
| Environ variableNEW_RELIC_INSTRUMENTATION_TILT |

Controls auto-instrumentation of the Tilt template rendering library at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

**instrumentation.typhoeus**

| TypeString                                         |
| -------------------------------------------------- |
| Defaultauto                                        |
| Environ variableNEW_RELIC_INSTRUMENTATION_TYPHOEUS |

Controls auto-instrumentation of Typhoeus at start-up. May be one of: `auto`, `prepend`, `chain`, `disabled`.

## Message Tracer [#message-tracer]

**message_tracer.segment_parameters.enabled**

| TypeBoolean                                                         |
| ------------------------------------------------------------------- |
| Defaulttrue                                                         |
| Environ variableNEW_RELIC_MESSAGE_TRACER_SEGMENT_PARAMETERS_ENABLED |

If `true`, the agent will collect metadata about messages and attach them as segment parameters.

## Mongo [#mongo]

**mongo.capture_queries**

| TypeBoolean                                     |
| ----------------------------------------------- |
| Defaulttrue                                     |
| Environ variableNEW_RELIC_MONGO_CAPTURE_QUERIES |

If `true`, the agent captures Mongo queries in transaction traces.

**mongo.obfuscate_queries**

| TypeBoolean                                       |
| ------------------------------------------------- |
| Defaulttrue                                       |
| Environ variableNEW_RELIC_MONGO_OBFUSCATE_QUERIES |

If `true`, the agent obfuscates Mongo queries in transaction traces.

## Opensearch [#opensearch]

**opensearch.capture_queries**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaulttrue                                          |
| Environ variableNEW_RELIC_OPENSEARCH_CAPTURE_QUERIES |

If `true`, the agent captures OpenSearch queries in transaction traces.

**opensearch.obfuscate_queries**

| TypeBoolean                                            |
| ------------------------------------------------------ |
| Defaulttrue                                            |
| Environ variableNEW_RELIC_OPENSEARCH_OBFUSCATE_QUERIES |

If `true`, the agent obfuscates OpenSearch queries in transaction traces.

## OpenTelemetry [#opentelemetry]

**opentelemetry.enabled**

| TypeBoolean                                     |
| ----------------------------------------------- |
| Defaultfalse                                    |
| Environ variableNEW_RELIC_OPENTELEMETRY_ENABLED |

A global configuration option for disabling all OpenTelemetry signals sent through New Relic. If `false`, no OpenTelemetry signals will be sent to New Relic. If `true`, the signal-specific enabled config option (e.g. opentelemetry.traces.enabled) determines whether telemetry of that signal type will be reported to New Relic.

**opentelemetry.traces.enabled**

| TypeBoolean                                            |
| ------------------------------------------------------ |
| Defaulttrue                                            |
| Environ variableNEW_RELIC_OPENTELEMETRY_TRACES_ENABLED |

Enables the creation of Transaction Trace segments and timeslice metrics from OpenTelemetry Spans. This will help drive New Relic UI experience for OpenTelemetry spans.

**opentelemetry.traces.include**

| TypeString                                             |
| ------------------------------------------------------ |
| Default""                                              |
| Environ variableNEW_RELIC_OPENTELEMETRY_TRACES_INCLUDE |

A comma-delimited list of OpenTelemetry Tracers, represented as a string (e.g. "AppTracer1,OpenTelemetry::Instrumentation::Bunny::Instrumentation"), that **will** have their traces sent to New Relic.

**opentelemetry.traces.exclude**

| TypeString                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Defaultelasticsearch-api,dalli,OpenTelemetry::Instrumentation::ActionMailer::Instrumentation,OpenTelemetry::Instrumentation::ActionPack::Instrumentation,OpenTelemetry::Instrumentation::ActionView::Instrumentation,OpenTelemetry::Instrumentation::ActiveJob::Instrumentation,OpenTelemetry::Instrumentation::ActiveRecord::Instrumentation,OpenTelemetry::Instrumentation::ActiveStorage::Instrumentation,OpenTelemetry::Instrumentation::ActiveSupport::Instrumentation,OpenTelemetry::Instrumentation::AwsLambda::Instrumentation,OpenTelemetry::Instrumentation::AwsSdk::Instrumentation,OpenTelemetry::Instrumentation::Bunny::Instrumentation,OpenTelemetry::Instrumentation::ConcurrentRuby::Instrumentation,OpenTelemetry::Instrumentation::Dalli::Instrumentation,OpenTelemetry::Instrumentation::Ethon::Instrumentation,OpenTelemetry::Instrumentation::Excon::Instrumentation,OpenTelemetry::Instrumentation::Grape::Instrumentation,OpenTelemetry::Instrumentation::GraphQL::Instrumentation,OpenTelemetry::Instrumentation::Grpc::Instrumentation,OpenTelemetry::Instrumentation::HTTP&#x3A;:Instrumentation,OpenTelemetry::Instrumentation::HttpClient::Instrumentation,OpenTelemetry::Instrumentation::HTTPX::Instrumentation,OpenTelemetry::Instrumentation::Logger::Instrumentation,OpenTelemetry::Instrumentation::Mongo::Instrumentation,OpenTelemetry::Instrumentation::Net::HTTP&#x3A;:Instrumentation,OpenTelemetry::Instrumentation::Rack::Instrumentation,OpenTelemetry::Instrumentation::Rails::Instrumentation,OpenTelemetry::Instrumentation::Rake::Instrumentation,OpenTelemetry::Instrumentation::Rdkafka::Instrumentation,OpenTelemetry::Instrumentation::Redis::Instrumentation,OpenTelemetry::Instrumentation::Resque::Instrumentation,OpenTelemetry::Instrumentation::RubyKafka::Instrumentation,OpenTelemetry::Instrumentation::Sidekiq::Instrumentation,OpenTelemetry::Instrumentation::Sinatra::Instrumentation |
| Environ variableNEW_RELIC_OPENTELEMETRY_TRACES_EXCLUDE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

A comma-delimited list of OpenTelemetry Tracers, represented as a string (e.g. "AppTracer1,OpenTelemetry::Instrumentation::Bunny::Instrumentation"), that will **not** have their traces sent to New Relic.

## Process Host [#process-host]

**process_host.display_name**

| TypeString                                          |
| --------------------------------------------------- |
| Default(Dynamic)                                    |
| Environ variableNEW_RELIC_PROCESS_HOST_DISPLAY_NAME |

Specify a custom hostname for [display in the New Relic UI](https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/add-rename-remove-hosts#display_name).

## Puma [#puma]

**puma.sample_rate**

| TypeInteger                                |
| ------------------------------------------ |
| Default60                                  |
| Environ variableNEW_RELIC_PUMA_SAMPLE_RATE |

Number of seconds between samples of Puma server statistics taken in the Puma master process.

## Rake [#rake]

**rake.tasks**

| TypeArray                            |
| ------------------------------------ |
| Default\[]                           |
| Environ variableNEW_RELIC_RAKE_TASKS |

Specify an Array of Rake tasks to automatically instrument. This configuration option converts the Array to a RegEx list. No rake tasks will be instrumented unless they're added to this list. If you'd like to allow all tasks by default, use `rake.tasks: [.+]`. For more information, visit the [New Relic Rake Instrumentation docs](https://docs.newrelic.com/docs/apm/agents/ruby-agent/background-jobs/rake-instrumentation).

**rake.connect_timeout**

| TypeInteger                                    |
| ---------------------------------------------- |
| Default10                                      |
| Environ variableNEW_RELIC_RAKE_CONNECT_TIMEOUT |

Defines the number of seconds to wait for a connection to complete before running a Rake task.

## Rules [#rules]

**rules.ignore_url_regexes**

| TypeArray                                          |
| -------------------------------------------------- |
| Default\[]                                         |
| Environ variableNEW_RELIC_RULES_IGNORE_URL_REGEXES |

Define transactions you want the agent to ignore by specifying a list of patterns matching the URIs to exclude. For more detail, see [the docs on ignoring specific transactions](https://docs.newrelic.com/docs/agents/ruby-agent/api-guides/ignoring-specific-transactions/#config-ignoring).

## Security [#security]

**security.agent.enabled**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaultfalse                                     |
| Environ variableNEW_RELIC_SECURITY_AGENT_ENABLED |

If `true`, the security agent is loaded (a Ruby 'require' is performed).

**security.enabled**

| TypeBoolean                                |
| ------------------------------------------ |
| Defaultfalse                               |
| Environ variableNEW_RELIC_SECURITY_ENABLED |

If `true`, the security agent is started (the agent runs in its event loop).

**security.mode**

| TypeString                              |
| --------------------------------------- |
| Default"IAST"                           |
| Environ variableNEW_RELIC_SECURITY_MODE |

Defines the mode for the security agent to operate in. Currently only `IAST` is supported.

**security.validator_service_url**

| TypeString                                               |
| -------------------------------------------------------- |
| Default"wss://csec.nr-data.net"                          |
| Environ variableNEW_RELIC_SECURITY_VALIDATOR_SERVICE_URL |

Defines the endpoint URL for posting security-related data.

**security.application_info.port**

| TypeInteger                                              |
| -------------------------------------------------------- |
| Defaultnil                                               |
| Environ variableNEW_RELIC_SECURITY_APPLICATION_INFO_PORT |

The port the application is listening on. This setting is mandatory for Passenger servers. The agent detects other servers by default.

**security.exclude_from_iast_scan.api**

| TypeArray                                                     |
| ------------------------------------------------------------- |
| Default\[]                                                    |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_API |

Defines API paths the security agent should ignore in IAST scans. Accepts an array of regex patterns matching the URI to ignore. The regex pattern should find a complete match for the URL without the endpoint. For example, `[".*account.*"], [".*/\api\/v1\/.*?\/login"]`

**security.exclude_from_iast_scan.http_request_parameters.header**

| TypeArray                                                                                |
| ---------------------------------------------------------------------------------------- |
| Default\[]                                                                               |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_HTTP_REQUEST_PARAMETERS_HEADER |

An array of HTTP request headers the security agent should ignore in IAST scans. The array should specify a list of patterns matching the headers to ignore.

**security.exclude_from_iast_scan.http_request_parameters.query**

| TypeArray                                                                               |
| --------------------------------------------------------------------------------------- |
| Default\[]                                                                              |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_HTTP_REQUEST_PARAMETERS_QUERY |

An array of HTTP request query parameters the security agent should ignore in IAST scans. The array should specify a list of patterns matching the HTTP request query parameters to ignore.

**security.exclude_from_iast_scan.http_request_parameters.body**

| TypeArray                                                                              |
| -------------------------------------------------------------------------------------- |
| Default\[]                                                                             |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_HTTP_REQUEST_PARAMETERS_BODY |

An array of HTTP request body keys the security agent should ignore in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.insecure_settings**

| TypeBoolean                                                                                         |
| --------------------------------------------------------------------------------------------------- |
| Defaultfalse                                                                                        |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_INSECURE_SETTINGS |

If `true`, disables the detection of low-severity insecure settings. For example, hash, crypto, cookie, random generators, and trust boundary.

**security.exclude_from_iast_scan.iast_detection_category.invalid_file_access**

| TypeBoolean                                                                                           |
| ----------------------------------------------------------------------------------------------------- |
| Defaultfalse                                                                                          |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_INVALID_FILE_ACCESS |

If `true`, disables file operation-related IAST detections (File Access & Application integrity violation)

**security.exclude_from_iast_scan.iast_detection_category.sql_injection**

| TypeBoolean                                                                                     |
| ----------------------------------------------------------------------------------------------- |
| Defaultfalse                                                                                    |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_SQL_INJECTION |

If `true`, disables SQL injection detection in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.nosql_injection**

| TypeBoolean                                                                                       |
| ------------------------------------------------------------------------------------------------- |
| Defaultfalse                                                                                      |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_NOSQL_INJECTION |

If `true`, disables NoSQL injection detection in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.ldap_injection**

| TypeBoolean                                                                                      |
| ------------------------------------------------------------------------------------------------ |
| Defaultfalse                                                                                     |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_LDAP_INJECTION |

If `true`, disables LDAP injection detection in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.javascript_injection**

| TypeBoolean                                                                                            |
| ------------------------------------------------------------------------------------------------------ |
| Defaultfalse                                                                                           |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_JAVASCRIPT_INJECTION |

If `true`, disables JavaScript injection detection in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.command_injection**

| TypeBoolean                                                                                         |
| --------------------------------------------------------------------------------------------------- |
| Defaultfalse                                                                                        |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_COMMAND_INJECTION |

If `true`, disables system command injection detection in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.xpath_injection**

| TypeBoolean                                                                                       |
| ------------------------------------------------------------------------------------------------- |
| Defaultfalse                                                                                      |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_XPATH_INJECTION |

If `true`, disables XPath injection detection in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.ssrf**

| TypeBoolean                                                                            |
| -------------------------------------------------------------------------------------- |
| Defaultfalse                                                                           |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_SSRF |

If `true`, disables Server-Side Request Forgery (SSRF) detection in IAST scans.

**security.exclude_from_iast_scan.iast_detection_category.rxss**

| TypeBoolean                                                                            |
| -------------------------------------------------------------------------------------- |
| Defaultfalse                                                                           |
| Environ variableNEW_RELIC_SECURITY_EXCLUDE_FROM_IAST_SCAN_IAST_DETECTION_CATEGORY_RXSS |

If `true`, disables Reflected Cross-Site Scripting (RXSS) detection in IAST scans.

**security.scan_schedule.delay**

| TypeInteger                                            |
| ------------------------------------------------------ |
| Default0                                               |
| Environ variableNEW_RELIC_SECURITY_SCAN_SCHEDULE_DELAY |

Specifies the delay time (in minutes) before the IAST scan begins after the application starts.

**security.scan_schedule.duration**

| TypeInteger                                               |
| --------------------------------------------------------- |
| Default0                                                  |
| Environ variableNEW_RELIC_SECURITY_SCAN_SCHEDULE_DURATION |

Specifies the duration (in minutes) for which the IAST scan is performed.

**security.scan_schedule.schedule**

| TypeString                                                |
| --------------------------------------------------------- |
| Default""                                                 |
| Environ variableNEW_RELIC_SECURITY_SCAN_SCHEDULE_SCHEDULE |

Specifies a cron expression that sets when the IAST scan should run.

**security.scan_schedule.always_sample_traces**

| TypeBoolean                                                           |
| --------------------------------------------------------------------- |
| Defaultfalse                                                          |
| Environ variableNEW_RELIC_SECURITY_SCAN_SCHEDULE_ALWAYS_SAMPLE_TRACES |

If `true`, allows IAST to continuously gather trace data in the background. The security agent uses collected data to perform an IAST scan at the scheduled time.

**security.scan_controllers.iast_scan_request_rate_limit**

| TypeInteger                                                                      |
| -------------------------------------------------------------------------------- |
| Default3600                                                                      |
| Environ variableNEW_RELIC_SECURITY_SCAN_CONTROLLERS_IAST_SCAN_REQUEST_RATE_LIMIT |

Sets the maximum number of HTTP requests allowed per minute for the IAST scan. Must be an integer between 12 and 3600 (default).

**security.scan_controllers.scan_instance_count**

| TypeInteger                                                             |
| ----------------------------------------------------------------------- |
| Default0                                                                |
| Environ variableNEW_RELIC_SECURITY_SCAN_CONTROLLERS_SCAN_INSTANCE_COUNT |

The number of application instances for a specific entity to perform IAST analysis on.

**security.scan_controllers.report_http_response_body**

| TypeBoolean                                                                   |
| ----------------------------------------------------------------------------- |
| Defaulttrue                                                                   |
| Environ variableNEW_RELIC_SECURITY_SCAN_CONTROLLERS_REPORT_HTTP_RESPONSE_BODY |

If `true`, enables the sending of HTTP responses bodies. Disabling this also disables Reflected Cross-Site Scripting (RXSS) vulnerability detection.

**security.iast_test_identifier**

| TypeString                                              |
| ------------------------------------------------------- |
| Defaultnil                                              |
| Environ variableNEW_RELIC_SECURITY_IAST_TEST_IDENTIFIER |

A unique test identifier when running IAST in a CI/CD environment to differentiate between different test runs. For example, a build number.

## Serverless Mode [#serverless-mode]

**serverless_mode.enabled**

| TypeBoolean                                       |
| ------------------------------------------------- |
| Defaultfalse                                      |
| Environ variableNEW_RELIC_SERVERLESS_MODE_ENABLED |

If `true`, the agent will operate in a streamlined mode suitable for use with short-lived serverless functions. NOTE: Only AWS Lambda functions are supported currently and this option isn't intended for use without [New Relic's Ruby Lambda layer](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring/) offering.

## Sidekiq [#sidekiq]

**sidekiq.args.include**

| TypeArray                                      |
| ---------------------------------------------- |
| Default\[]                                     |
| Environ variableNEW_RELIC_SIDEKIQ_ARGS_INCLUDE |

An array of strings that will collectively serve as an allowlist for filtering which Sidekiq job arguments get reported to New Relic. To capture any Sidekiq arguments, `job.sidekiq.args.*` must also be added to the separate `attributes.include` configuration option. Each string in this array will be turned into a regular expression via `Regexp.new` to permit advanced matching. For job argument hashes, if either a key or value matches, the pair will be included. All matching job argument array elements and job argument scalars will be included.

**sidekiq.args.exclude**

| TypeArray                                      |
| ---------------------------------------------- |
| Default\[]                                     |
| Environ variableNEW_RELIC_SIDEKIQ_ARGS_EXCLUDE |

An array of strings that will collectively serve as a denylist for filtering which Sidekiq job arguments get reported to New Relic. To capture any Sidekiq arguments, `job.sidekiq.args.*` must also be added to the separate `attributes.include` configuration option. Each string in this array will be turned into a regular expression via `Regexp.new` to permit advanced matching. For job argument hashes, if either a key or value matches, the pair will be excluded. All matching job argument array elements and job argument scalars will be excluded.

**sidekiq.ignore_retry_errors**

| TypeBoolean                                           |
| ----------------------------------------------------- |
| Defaultfalse                                          |
| Environ variableNEW_RELIC_SIDEKIQ_IGNORE_RETRY_ERRORS |

If `true`, the agent will ignore exceptions raised during Sidekiq's retry attempts and will only report the error if the job permanently fails.

**sidekiq.separate_transactions**

| TypeBoolean                                             |
| ------------------------------------------------------- |
| Defaultfalse                                            |
| Environ variableNEW_RELIC_SIDEKIQ_SEPARATE_TRANSACTIONS |

If `true`, the agent starts a new transaction when a Sidekiq job is executed during a web transaction. This prevents Sidekiq job execution time from being included in web transaction metrics.

## Slow SQL [#slow-sql]

**slow_sql.enabled**

| TypeBoolean                                |
| ------------------------------------------ |
| Defaulttrue                                |
| Environ variableNEW_RELIC_SLOW_SQL_ENABLED |

If `true`, the agent collects [slow SQL queries](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/viewing-slow-query-details).

**slow_sql.explain_threshold**

| TypeFloat                                            |
| ---------------------------------------------------- |
| Default0.5                                           |
| Environ variableNEW_RELIC_SLOW_SQL_EXPLAIN_THRESHOLD |

Specify a threshold in seconds. The agent collects [slow SQL queries](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/viewing-slow-query-details) and explain plans that exceed this threshold.

**slow_sql.explain_enabled**

| TypeBoolean                                        |
| -------------------------------------------------- |
| Defaulttrue                                        |
| Environ variableNEW_RELIC_SLOW_SQL_EXPLAIN_ENABLED |

If `true`, the agent collects explain plans in slow SQL queries. If this setting is omitted, the [`transaction_tracer.explain_enabled`](#transaction_tracer-explain_enabled) setting will be applied as the default setting for explain plans in slow SQL as well.

**slow_sql.record_sql**

| TypeString                                    |
| --------------------------------------------- |
| Defaultobfuscated                             |
| Environ variableNEW_RELIC_SLOW_SQL_RECORD_SQL |

Defines an obfuscation level for slow SQL queries. Valid options are `obfuscated`, `raw`, or `none`.

**slow_sql.use_longer_sql_id**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaultfalse                                         |
| Environ variableNEW_RELIC_SLOW_SQL_USE_LONGER_SQL_ID |

If `true`, the agent generates a longer `sql_id` for slow SQL traces. `sql_id` is used for aggregation of similar queries.

## Span Events [#span-events]

**span_events.enabled**

| TypeBoolean                                   |
| --------------------------------------------- |
| Defaulttrue                                   |
| Environ variableNEW_RELIC_SPAN_EVENTS_ENABLED |

If `true`, enables span event sampling.

**span_events.queue_size**

| TypeInteger                                      |
| ------------------------------------------------ |
| Default10000                                     |
| Environ variableNEW_RELIC_SPAN_EVENTS_QUEUE_SIZE |

Sets the maximum number of span events to buffer when streaming to the trace observer.

**span_events.max_samples_stored**

| TypeInteger                                              |
| -------------------------------------------------------- |
| Default2000                                              |
| Environ variableNEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED |

Defines the maximum number of span events reported from a single harvest. Any Integer between `1` and `10000` is valid. When configuring the agent for [AI monitoring](https://docs.newrelic.com/docs/ai-monitoring/intro-to-ai-monitoring), set to max value `10000`. This ensures the agent captures the maximum amount of distributed traces.

## Strip Exception Messages [#strip-exception-messages]

**strip_exception_messages.enabled**

| TypeBoolean                                                |
| ---------------------------------------------------------- |
| Defaultfalse                                               |
| Environ variableNEW_RELIC_STRIP_EXCEPTION_MESSAGES_ENABLED |

If `true`, the agent strips messages from all exceptions except those in the [allowed classes list](#strip_exception_messages-allowed_classes). Enabled automatically in [high security mode](https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security).

**strip_exception_messages.allowed_classes**

| TypeArray                                                          |
| ------------------------------------------------------------------ |
| Default\[]                                                         |
| Environ variableNEW_RELIC_STRIP_EXCEPTION_MESSAGES_ALLOWED_CLASSES |

Specify a list of exceptions you do not want the agent to strip when [strip_exception_messages](#strip_exception_messages-enabled) is `true`. Separate exceptions with a comma. For example, `"ImportantException,PreserveMessageException"`.

## Stripe [#stripe]

**stripe.user_data.include**

| TypeArray                                          |
| -------------------------------------------------- |
| Default\[]                                         |
| Environ variableNEW_RELIC_STRIPE_USER_DATA_INCLUDE |

An array of strings to specify which keys inside a Stripe event's `user_data` hash should be reported to New Relic. Each string in this array will be turned into a regular expression via `Regexp.new` to enable advanced matching. Setting the value to `["."]` will report all `user_data`.

**stripe.user_data.exclude**

| TypeArray                                          |
| -------------------------------------------------- |
| Default\[]                                         |
| Environ variableNEW_RELIC_STRIPE_USER_DATA_EXCLUDE |

An array of strings to specify which keys and/or values inside a Stripe event's `user_data` hash should not be reported to New Relic. Each string in this array will be turned into a regular expression via `Regexp.new` to permit advanced matching. For each hash pair, if either the key or value is matched the pair isn't reported. By default, no `user_data` is reported. Use this option only if the `stripe.user_data.include` option is also used.

## Thread Profiler [#thread-profiler]

**thread_profiler.enabled**

| TypeBoolean                                       |
| ------------------------------------------------- |
| Defaultfalse                                      |
| Environ variableNEW_RELIC_THREAD_PROFILER_ENABLED |

If `true`, enables use of the [thread profiler](https://docs.newrelic.com/docs/apm/applications-menu/events/thread-profiler-tool).

## Utilization [#utilization]

**utilization.detect_aws**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaulttrue                                      |
| Environ variableNEW_RELIC_UTILIZATION_DETECT_AWS |

If `true`, the agent automatically detects that it is running in an AWS environment.

**utilization.detect_azure**

| TypeBoolean                                        |
| -------------------------------------------------- |
| Defaulttrue                                        |
| Environ variableNEW_RELIC_UTILIZATION_DETECT_AZURE |

If `true`, the agent automatically detects that it is running in an Azure environment.

**utilization.detect_docker**

| TypeBoolean                                         |
| --------------------------------------------------- |
| Defaulttrue                                         |
| Environ variableNEW_RELIC_UTILIZATION_DETECT_DOCKER |

If `true`, the agent automatically detects that it is running in Docker.

**utilization.detect_gcp**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaulttrue                                      |
| Environ variableNEW_RELIC_UTILIZATION_DETECT_GCP |

If `true`, the agent automatically detects that it is running in a Google Cloud Platform environment.

**utilization.gcp_cloud_run.use_instance_as_host**

| TypeBoolean                                                              |
| ------------------------------------------------------------------------ |
| Defaulttrue                                                              |
| Environ variableNEW_RELIC_UTILIZATION_GCP_CLOUD_RUN_USE_INSTANCE_AS_HOST |

If `true`, the agent reports the GCP instance id as the hostname when running on Google Cloud Run (Services, Worker Pools, and Jobs).

**utilization.gcp_cloud_run.include_revision_in_host**

| TypeBoolean                                                                  |
| ---------------------------------------------------------------------------- |
| Defaultfalse                                                                 |
| Environ variableNEW_RELIC_UTILIZATION_GCP_CLOUD_RUN_INCLUDE_REVISION_IN_HOST |

If `true`, the agent prepends the Cloud Run revision name to the GCP instance id to form the hostname (`{revision}-{instance id}`) on Google Cloud Run. The revision name comes from `K_REVISION` on a Cloud Run Service, `CLOUD_RUN_REVISION` on a Cloud Run Worker Pool, and `CLOUD_RUN_EXECUTION` on a Cloud Run Job. Has no effect unless `utilization.gcp_cloud_run.use_instance_as_host` is also `true`.

**utilization.detect_kubernetes**

| TypeBoolean                                             |
| ------------------------------------------------------- |
| Defaulttrue                                             |
| Environ variableNEW_RELIC_UTILIZATION_DETECT_KUBERNETES |

If `true`, the agent automatically detects that it is running in Kubernetes.

**utilization.detect_pcf**

| TypeBoolean                                      |
| ------------------------------------------------ |
| Defaulttrue                                      |
| Environ variableNEW_RELIC_UTILIZATION_DETECT_PCF |

If `true`, the agent automatically detects that it is running in a Pivotal Cloud Foundry environment.

**utilization.detect_in_parallel**

| TypeBoolean                                              |
| -------------------------------------------------------- |
| Defaulttrue                                              |
| Environ variableNEW_RELIC_UTILIZATION_DETECT_IN_PARALLEL |

If `true`, the agent will perform environment detection in parallel to speed up agent startup time.

## Errors inbox configuration [#errors-inbox-configuration]

Setting one of the following environment variables will help you identify which versions of your software produced the errors.

-   `NEW_RELIC_METADATA_SERVICE_VERSION` creates `tags.service.version` on event data containing the version of your code that is deployed, in many cases a semantic version such as `1.2.3`, but not always.
-   `NEW_RELIC_METADATA_RELEASE_TAG` creates `tags.releaseTag` on event data containing the release tag (such as `v0.1.209` or `release-209`).
-   `NEW_RELIC_METADATA_COMMIT` creates `tags.commit` on event data containing the commit SHA. The entire SHA can be used or just the first seven characters (e.g., `734713b`).

[Errors inbox](https://docs.newrelic.com/docs/errors-inbox/version-tracking/) will automatically track which versions of your software are producing errors.
