Configure the core Ruby agent settings including app name, license key, proxy, logging, and general agent behavior.
General
These settings are available for agent configuration. Some settings depend on your New Relic subscription level.
| Type | Boolean |
|---|---|
| Default | true |
| Environ variable | NEW_RELIC_AGENT_ENABLED |
If true, allows the Ruby agent to run.
| Type | String |
|---|---|
| Default | (Dynamic) |
| Environ variable | NEW_RELIC_APP_NAME |
Specify the application name used to aggregate data in the New Relic UI. To report data to multiple apps at the same time, specify a list of names separated by a semicolon ;. For example, MyApp or MyStagingApp;Instance1.
| Type | String |
|---|---|
| Default | "" |
| Environ variable | NEW_RELIC_LICENSE_KEY |
Your New Relic .
| Type | String |
|---|---|
| Default | "info" |
| Environ variable | NEW_RELIC_LOG_LEVEL |
Sets the level of detail of log messages. Possible log levels, in increasing verbosity, are: fatal, error, warn, info or debug.
| Type | Array |
|---|---|
| Default | [] |
| Environ variable | NEW_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]
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_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.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_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.
| Type | String |
|---|---|
| Default | nil |
| Environ variable | NEW_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.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_CAPTURE_MEMCACHE_KEYS |
If true, the agent captures memcache keys in transaction traces.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_CAPTURE_PARAMS |
When true, the agent captures HTTP request parameters and attaches them to transaction traces, traced errors, and TransactionError events.
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 instead. For more information, see the Ruby attribute examples.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_CLEAR_TRANSACTION_STATE_AFTER_FORK |
If true, the agent will clear Tracer::State in Agent.drop_buffered_data.
| Type | String |
|---|---|
| Default | (Dynamic) |
| Environ variable | NEW_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
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_EXCLUDE_NEWRELIC_HEADER |
If true, suppresses the newrelic distributed tracing header on outbound requests.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_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.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_HIGH_SECURITY |
If true, enables high security mode. Ensure you understand the implications of high security mode before enabling this setting.
| Type | String |
|---|---|
| Default | "" |
| Environ variable | NEW_RELIC_LABELS |
A dictionary of label names 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.
| Type | String |
|---|---|
| Default | "newrelic_agent.log" |
| Environ variable | NEW_RELIC_LOG_FILE_NAME |
Defines a name for the log file.
| Type | String |
|---|---|
| Default | "log/" |
| Environ variable | NEW_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.
| Type | String |
|---|---|
| Default | "json" |
| Environ variable | NEW_RELIC_MARSHALLER |
Specifies a marshaller for transmitting data to the New Relic collector. Currently json is the only valid value for this setting.
| Type | Boolean |
|---|---|
| Default | true |
| Environ variable | NEW_RELIC_MONITOR_MODE |
When true, the agent transmits data about your app to the New Relic collector.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_PREPEND_ACTIVE_RECORD_INSTRUMENTATION |
If true, uses Module#prepend rather than alias_method for ActiveRecord instrumentation.
| Type | String |
|---|---|
| Default | nil |
| Environ variable | NEW_RELIC_PROXY_HOST |
Defines a host for communicating with the New Relic collector via a proxy server.
| Type | String |
|---|---|
| Default | nil |
| Environ variable | NEW_RELIC_PROXY_PASS |
Defines a password for communicating with the New Relic collector via a proxy server.
| Type | Integer |
|---|---|
| Default | 8080 |
| Environ variable | NEW_RELIC_PROXY_PORT |
Defines a port for communicating with the New Relic collector via a proxy server.
| Type | String |
|---|---|
| Default | nil |
| Environ variable | NEW_RELIC_PROXY_USER |
Defines a user for communicating with the New Relic collector via a proxy server.
| Type | Boolean |
|---|---|
| Default | true |
| Environ variable | NEW_RELIC_SEND_DATA_ON_EXIT |
If true, enables the exit handler that sends data to the New Relic collector before shutting down.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_SYNC_STARTUP |
When set to true, forces a synchronous connection to the New Relic collector during application startup. For very short-lived processes, this helps ensure the New Relic agent has time to report.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_THREAD_LOCAL_TRACER_STATE |
If true, tracer state storage is thread-local, otherwise, fiber-local.
| Type | Integer |
|---|---|
| Default | 120 |
| Environ variable | NEW_RELIC_TIMEOUT |
Defines the maximum number of seconds the agent should spend attempting to connect to the collector.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_ALLOW_ALL_HEADERS |
If true, enables capture of all HTTP request headers for all destinations.
| Type | Array |
|---|---|
| Default | [] |
| Environ variable | NEW_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:
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 endGiven that source code, the newrelic.yml config file might request instrumentation for both of these methods like so:
automatic_custom_instrumentation_method_list: - MyCompany::Image#render_png - MyCompany::User.notifyThat configuration example uses YAML array syntax to specify both methods. Alternatively, you can use a comma-delimited string:
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:
$export NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST='MyCompany::Image#render_png, MyCompany::User.notify'| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_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.
| Type | Array |
|---|---|
| Default | [] |
| Environ variable | NEW_RELIC_IGNORED_MIDDLEWARE_CLASSES |
A list of middleware class or module names the agent should ignore. Example: ["Rack::Cors", "ActionDispatch::Reloader"]
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_DEFER_RAILS_INITIALIZATION |
If true, when the agent is in an application using Ruby on Rails, it will start after config/initializers run.