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
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:
The Ruby agent follows this order of precedence for configuration:
Environment variables
Server-side configuration
Configuration file (newrelic.yml)
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
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; for example, Development, Testing, 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, for example, 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:
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
For non-Rails apps, the Ruby agent looks for the following environment variables, in this order, to determine the application environment:
NEW_RELIC_ENV
RUBY_ENV
RAILS_ENV
APP_ENV
RACK_ENV
If the Ruby agent does not 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 determine 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 or RAILS.env, depending on the version of Rails) .
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
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 to take advantage of new configuration options.
Important
Updating the gem does not automatically update config/newrelic.yml.
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: 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
String
Default
""
Environ variable
NEW_RELIC_API_KEY
Your New Relic . Required when using the New Relic REST API v2 to record deployments using the newrelic deployments command.
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 will be used to validate the SSL certificate presented by New Relic's data collection service.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_CAPTURE_MEMCACHE_KEYS
Enable or disable the capture of memcache keys from 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
Allows newrelic distributed tracing headers to be suppressed on outbound requests.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_FORCE_INSTALL_EXIT_HANDLER
Forces the exit handler that sends all cached data to collector before shutting down to be installed regardless of detecting scenarios where it generally should not be. Known use-case for this option is where Sinatra is running as an embedded service within another framework and the agent is detecting the Sinatra app and skipping the at_exit handler as a result. Sinatra classically runs the entire application in an at_exit block and would otherwise misbehave if the Agent's at_exit handler was also installed in those circumstances. Note: send_data_on_exit should also be set to true in tandem with this setting.
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.
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
String
Default
""
Environ variable
NEW_RELIC_SECURITY_POLICIES_TOKEN
Applies Language Agent Security Policy settings.
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
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
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.
Caution
This option may only be set by environment variable.
Transaction Tracer
The 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.
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 is not set separately.
Type
Float
Default
0.5
Environ variable
NEW_RELIC_TRANSACTION_TRACER_EXPLAIN_THRESHOLD
Threshold (in seconds) above which the agent will collect explain plans. Relevant only when explain_enabled is true.
Type
Integer
Default
4000
Environ variable
NEW_RELIC_TRANSACTION_TRACER_LIMIT_SEGMENTS
Maximum number of transaction trace nodes to record in a single transaction trace.
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
The agent collects and reports all uncaught exceptions by default. These configuration options allow you to customize the error collection.
If true, the agent captures traced errors and error count metrics.
Type
Array
Default
[]
Environ variable
None
A list of error classes that the agent should treat as expected.
Caution
This option can't be set via environment variable.
Type
Hash
Default
{}
Environ variable
None
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.
Caution
This option can't be set via environment variable.
Type
String
Default
""
Environ variable
NEW_RELIC_ERROR_COLLECTOR_EXPECTED_STATUS_CODES
A comma separated list of status codes, possibly including ranges. Errors associated with these status codes, where applicable, will be treated as expected.
Type
Hash
Default
{}
Environ variable
None
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.
Caution
This option can't be set via environment variable.
Type
String
Default
""
Environ variable
NEW_RELIC_ERROR_COLLECTOR_IGNORE_STATUS_CODES
A comma separated list of status codes, possibly including ranges. Errors associated with these status codes, where applicable, will be ignored.
Type
Integer
Default
50
Environ variable
NEW_RELIC_ERROR_COLLECTOR_MAX_BACKTRACE_FRAMES
Defines the maximum number of frames in an error backtrace. Backtraces over this amount are truncated at the beginning and end.
If set to false, agent omits input and output content (like text strings from prompts and responses) captured in LLM events.
Drops content attribute from LlmChatCompletionMessage events
Drops input attribute froom LlmEmbedding events
This is an optional security setting if you don’t want to record sensitive data sent to and received from your LLMs.
Browser Monitoring
The page load timing 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.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT
If true, enables auto-injection of the JavaScript header for page load timing (sometimes referred to as real user monitoring or RUM).
Transaction Events
Type
Boolean
Default
true
Environ variable
NEW_RELIC_TRANSACTION_EVENTS_ENABLED
If true, enables transaction event sampling.
Type
Integer
Default
1200
Environ variable
NEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STORED
Defines the maximum number of transaction events reported from a single harvest.
The intention is to forward logs with the level given to the configuration, as well as any logs with a higher level of severity.
For example, setting this value to "debug" will forward all log events to New Relic. Setting this value to "error" will only forward log events with the levels "error", "fatal", and "unknown".
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"
If true, the agent decorates logs with metadata to link to entities, hosts, traces, and spans.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_APPLICATION_LOGGING_METRICS_ENABLED
If true, the agent captures metrics related to logging for your application.
Ai Monitoring
This section includes Ruby agent configurations for setting up AI monitoring. Distributed tracing must be enabled to capture trace and feedback data. It is turned on by default in Ruby agents 8.0.0 and higher.
Type
Boolean
Default
false
Environ variable
NEW_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.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_AI_MONITORING_RECORD_CONTENT_ENABLED
If false, LLM instrumentation (OpenAI only for now) will not capture input and output content on specific LLM events.
The excluded attributes include:
content from LlmChatCompletionMessage events
input from LlmEmbedding events
Attributes
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
Type
Boolean
Default
true
Environ variable
NEW_RELIC_ATTRIBUTES_ENABLED
If true, enables capture of attributes for all destinations.
Type
Array
Default
[]
Environ variable
NEW_RELIC_ATTRIBUTES_EXCLUDE
Prefix of attributes to exclude from all destinations. Allows * as wildcard at end.
Type
Array
Default
[]
Environ variable
NEW_RELIC_ATTRIBUTES_INCLUDE
Prefix of attributes to include in all destinations. Allows * as wildcard at end.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_ENABLED
If true, the agent captures attributes from browser monitoring.
Type
Array
Default
[]
Environ variable
NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_EXCLUDE
Prefix of attributes to exclude from browser monitoring. Allows * as wildcard at end.
Type
Array
Default
[]
Environ variable
NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_INCLUDE
Prefix of attributes to include in browser monitoring. Allows * as wildcard at end.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_ENABLED
If true, the agent captures attributes from error collection.
Type
Array
Default
[]
Environ variable
NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_EXCLUDE
Prefix of attributes to exclude from error collection. Allows * as wildcard at end.
Type
Array
Default
[]
Environ variable
NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_INCLUDE
Prefix of attributes to include in error collection. Allows * as wildcard at end.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_ENABLED
If true, the agent captures attributes on span events.
Type
Array
Default
[]
Environ variable
NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_EXCLUDE
Prefix of attributes to exclude from span events. Allows * as wildcard at end.
Type
Array
Default
[]
Environ variable
NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_INCLUDE
Prefix of attributes to include on span events. Allows * as wildcard at end.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_ENABLED
If true, the agent captures attributes from transaction events.
Type
Array
Default
[]
Environ variable
NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_EXCLUDE
Prefix of attributes to exclude from transaction events. Allows * as wildcard at end.
Type
Array
Default
[]
Environ variable
NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_INCLUDE
Prefix of attributes to include in transaction events. Allows * as wildcard at end.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_ENABLED
If true, the agent captures attributes on transaction segments.
Type
Array
Default
[]
Environ variable
NEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_EXCLUDE
Prefix of attributes to exclude from transaction segments. Allows * as wildcard at end.
Type
Array
Default
[]
Environ variable
NEW_RELIC_TRANSACTION_SEGMENTS_ATTRIBUTES_INCLUDE
Prefix of attributes to include on transaction segments. Allows * as wildcard at end.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_ENABLED
If true, the agent captures attributes from transaction traces.
Type
Array
Default
[]
Environ variable
NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_EXCLUDE
Prefix of attributes to exclude from transaction traces. Allows * as wildcard at end.
Type
Array
Default
[]
Environ variable
NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_INCLUDE
Prefix of attributes to include in transaction traces. Allows * as wildcard at end.
Audit Log
Type
Boolean
Default
false
Environ variable
NEW_RELIC_AUDIT_LOG_ENABLED
If true, enables an audit log which logs communications with the New Relic collector.
Type
Array
Default
[".*"]
Environ variable
NEW_RELIC_AUDIT_LOG_ENDPOINTS
List of allowed endpoints to include in audit log.
Type
String
Default
log/newrelic_audit.log
Environ variable
NEW_RELIC_AUDIT_LOG_PATH
Specifies a path to the audit log file (including the filename).
Specify a list of constants that should prevent the agent from starting automatically. Separate individual constants with a comma ,. For example, "Rails::Console,UninstrumentedBackgroundJob".
Type
String
Default
"irb,rspec"
Environ variable
NEW_RELIC_AUTOSTART_DENYLISTED_EXECUTABLES
Defines a comma-delimited list of executables that the agent should not instrument. For example, "rake,my_ruby_script.rb".
Setting one of the following tags will help you identify which versions of your software are producing the errors.
NEW_RELIC_METADATA_SERVICE_VERSION will create 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 will create tags.releaseTag on event data containing the release tag (such as v0.1.209 or release-209).
NEW_RELIC_METADATA_COMMIT will create tags.commit on event data containing the commit sha. The entire sha can be used or just the first seven characters (e.g., 734713b).
An upcoming release of errors inbox will automatically track which versions of your software are producing errors. Any version data will also be displayed in CodeStream.
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
Use these settings to toggle instrumentation types during agent startup.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTION_CABLE_INSTRUMENTATION
If true, disables Action Cable instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTION_CONTROLLER
If true, disables Action Controller instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTION_MAILBOX
If true, disables Action Mailbox instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTION_MAILER
If true, disables Action Mailer instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTIVEJOB
If true, disables Active Job instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTIVE_STORAGE
If true, disables Active Storage instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTIVE_SUPPORT
If true, disables Active Support instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTIVE_RECORD_INSTRUMENTATION
If true, disables Active Record instrumentation.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_ACTIVE_RECORD_NOTIFICATIONS
If true, disables instrumentation for Active Record 4+
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_CPU_SAMPLER
If true, the agent won't sample the CPU usage of the host process.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_DELAYED_JOB_SAMPLER
If true, the agent won't measure the depth of Delayed Job queues.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_GC_PROFILER
If true, disables the use of GC::Profiler to measure time spent in garbage collection
Type
Boolean
Default
false
Environ variable
NEW_RELIC_DISABLE_MEMORY_SAMPLER
If true, the agent won't sample the memory usage of the host process.
Type
Boolean
Default
false
Environ variable
NEW_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).
Important
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.
Type
Boolean
Default
false
Environ variable
NEW_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).
If true, disables agent middleware for Roda. This middleware is responsible for advanced feature support such as page load timing and error collection.
Cross application tracing is deprecated in favor of distributed tracing. Distributed tracing is on by default for Ruby agent versions 8.0.0 and above. Middlewares are not required to support distributed tracing.
To continue using cross application tracing, update the following options in your newrelic.yml configuration file:
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 before you enable this feature.
Elasticsearch
Type
Boolean
Default
true
Environ variable
NEW_RELIC_ELASTICSEARCH_CAPTURE_QUERIES
If true, the agent captures Elasticsearch queries in transaction traces.
Type
Boolean
Default
true
Environ variable
NEW_RELIC_ELASTICSEARCH_OBFUSCATE_QUERIES
If true, the agent obfuscates Elasticsearch queries in transaction traces.
Heroku
Type
Boolean
Default
true
Environ variable
NEW_RELIC_HEROKU_USE_DYNO_NAMES
If true, the agent uses Heroku dyno names as the hostname.
Type
Array
Default
["scheduler", "run"]
Environ variable
NEW_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
Type
String
Default
""
Environ variable
NEW_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.
Type
Integer
Default
443
Environ variable
NEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_PORT
Configures the TCP/IP port for the trace observer Host
Type
Boolean
Default
true
Environ variable
NEW_RELIC_INFINITE_TRACING_BATCHING
If true (the default), data sent to the trace observer is batched instead of sending each span individually.
Type
Symbol
Default
:high
Environ variable
NEW_RELIC_INFINITE_TRACING_COMPRESSION_LEVEL
Configure the compression level for data sent to the trace observer.
Controls auto-instrumentation of ActiveSupport::BroadcastLogger at start up. May be one of: auto, prepend, chain, disabled. Used in Rails versions >= 7.1.
Type
String
Default
auto
Environ variable
NEW_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.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_ASYNC_HTTP
Controls auto-instrumentation of Async::HTTP at start up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_BUNNY
Controls auto-instrumentation of bunny at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_FIBER
Controls auto-instrumentation of the Fiber class at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_CONCURRENT_RUBY
Controls auto-instrumentation of the concurrent-ruby library at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_CURB
Controls auto-instrumentation of Curb at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_DELAYED_JOB
Controls auto-instrumentation of Delayed Job at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_ELASTICSEARCH
Controls auto-instrumentation of the elasticsearch library at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_ETHON
Controls auto-instrumentation of ethon at start up. May be one of [auto|prepend|chain|disabled]
Type
String
Default
enabled
Environ variable
NEW_RELIC_INSTRUMENTATION_EXCON
Controls auto-instrumentation of Excon at start-up. May be one of: enabled, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_GRAPE
Controls auto-instrumentation of Grape at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_GRPC_CLIENT
Controls auto-instrumentation of gRPC clients at start-up. May be one of: auto, prepend, chain, disabled.
Type
Array
Default
[]
Environ variable
NEW_RELIC_INSTRUMENTATION_GRPC_HOST_DENYLIST
Specifies a list of hostname patterns separated by commas that will match gRPC hostnames that traffic is to be ignored by New Relic for. New Relic's gRPC client instrumentation will ignore traffic streamed to a host matching any of these patterns, and New Relic's gRPC server instrumentation will ignore traffic for a server running on a host whose hostname matches any of these patterns. By default, no traffic is ignored when gRPC instrumentation is itself enabled. For example, "private.com$,exception.*"
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_GRPC_SERVER
Controls auto-instrumentation of gRPC servers at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_HTTPCLIENT
Controls auto-instrumentation of HTTPClient at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_HTTPRB
Controls auto-instrumentation of http.rb gem at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_HTTPX
Controls auto-instrumentation of httpx at start up. May be one of [auto|prepend|chain|disabled]
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_LOGGER
Controls auto-instrumentation of Ruby standard library Logger at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_MEMCACHE
Controls auto-instrumentation of dalli gem for Memcache at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_MEMCACHED
Controls auto-instrumentation of memcached gem for Memcache at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_MEMCACHE_CLIENT
Controls auto-instrumentation of memcache-client gem for Memcache at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
enabled
Environ variable
NEW_RELIC_INSTRUMENTATION_MONGO
Controls auto-instrumentation of Mongo at start-up. May be one of: enabled, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_NET_HTTP
Controls auto-instrumentation of Net::HTTP at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_RUBY_OPENAI
Controls auto-instrumentation of the ruby-openai gem at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_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.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_PUMA_RACK_URLMAP
Controls auto-instrumentation of Puma::Rack::URLMap at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_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.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_RACK_URLMAP
Controls auto-instrumentation of Rack::URLMap at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_RAKE
Controls auto-instrumentation of rake at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_REDIS
Controls auto-instrumentation of Redis at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_RESQUE
Controls auto-instrumentation of resque at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_RODA
Controls auto-instrumentation of Roda at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_SINATRA
Controls auto-instrumentation of Sinatra at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"enabled"
Environ variable
NEW_RELIC_INSTRUMENTATION_STRIPE
Controls auto-instrumentation of Stripe at startup. May be one of: enabled, disabled.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_VIEW_COMPONENT
Controls auto-instrumentation of ViewComponent at startup. May be one of: auto, prepend, chain, disabled.
Type
String
Default
"auto"
Environ variable
NEW_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.
Type
Boolean
Default
true
Environ variable
NEW_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.
Type
String
Default
"auto"
Environ variable
NEW_RELIC_INSTRUMENTATION_TILT
Controls auto-instrumentation of the Tilt template rendering library at start-up. May be one of: auto, prepend, chain, disabled.
Type
String
Default
auto
Environ variable
NEW_RELIC_INSTRUMENTATION_TYPHOEUS
Controls auto-instrumentation of Typhoeus at start-up. May be one of: auto, prepend, chain, disabled.
Specify an Array of Rake tasks to automatically instrument. This configuration option converts the Array to a RegEx list. If you'd like to allow all tasks by default, use rake.tasks: [.+]. No rake tasks will be instrumented unless they're added to this list. For more information, visit the New Relic Rake Instrumentation docs.
Type
Integer
Default
10
Environ variable
NEW_RELIC_RAKE_CONNECT_TIMEOUT
Timeout for waiting on connect to complete before a rake task
Rules
Type
Array
Default
[]
Environ variable
NEW_RELIC_RULES_IGNORE_URL_REGEXES
Define transactions you want the agent to ignore, by specifying a list of patterns matching the URI you want to ignore. For more detail, see the docs on ignoring specific transactions.
Sidekiq
Type
Array
Default
[]
Environ variable
NEW_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 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.
Type
Array
Default
[]
Environ variable
NEW_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 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.
Specify a threshold in seconds. The agent collects slow SQL queries and explain plans that exceed this threshold.
Type
Boolean
Default
true
Environ variable
NEW_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 setting will be applied as the default setting for explain plans in slow SQL as well.
Type
String
Default
obfuscated
Environ variable
NEW_RELIC_SLOW_SQL_RECORD_SQL
Defines an obfuscation level for slow SQL queries. Valid options are obfuscated, raw, or none.
Type
Boolean
Default
false
Environ variable
NEW_RELIC_SLOW_SQL_USE_LONGER_SQL_ID
Generate a longer sql_id for slow SQL traces. sql_id is used for aggregation of similar queries.
Span events
Type
Boolean
Default
true
Environ variable
NEW_RELIC_SPAN_EVENTS_ENABLED
If true, enables span event sampling.
Type
Integer
Default
10000
Environ variable
NEW_RELIC_SPAN_EVENTS_QUEUE_SIZE
Sets the maximum number of span events to buffer when streaming to the trace observer.
Type
Integer
Default
2000
Environ variable
NEW_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, set to max value 10000. Ensures that the agent captures the maximum amount of distributed traces.
Strip Exception Messages
Type
Boolean
Default
false
Environ variable
NEW_RELIC_STRIP_EXCEPTION_MESSAGES_ENABLED
If true, the agent strips messages from all exceptions except those in the allowlist. Enabled automatically in high security mode.
Specify a list of exceptions you do not want the agent to strip when strip_exception_messages is true. Separate exceptions with a comma. For example, "ImportantException,PreserveMessageException".
Stripe
Type
Array
Default
[]
Environ variable
NEW_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
permit advanced matching. Setting the value to ["."] will report all user_data.
Type
Array
Default
[]
Environ variable
NEW_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 will not be reported. By default, no user_data is reported, so this option should only be used if
the stripe.user_data.include option is being used.