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

Configure the core Ruby agent settings including app name, license key, proxy, logging, and general agent behavior.

## 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).

> #### ⚠️ CAUTION
>
> 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](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby) 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.
