These settings cover additional Node.js agent configuration options including cloud provider variables, API configuration, event sampling, custom parameters, URL obfuscation, security, hosting services, and more.
The AWS account ID for the AWS account associated with this app.
Audit logging
This section defines the Node.js agent variables in the order they typically appear in the audit_log: { section of your app's newrelic.js configuration file.
When enabled, the agent logs the payloads it sends to the collector. This data is included in the main log file even when logging level is set to the lowest level.
The agent sends several different types of data to the collector in separate payloads. By default, all of them are included in the log file. This option makes it possible to limit logging only to specific types of data.
Valid values include:
agent_settings
analytic_event_data
connect
custom_event_data
error_data
error_event_data
metric_data
preconnect
shutdown
span_event_data
sql_trace_data
transaction_sample_data
API configuration
This section allows you to choose which API methods are enabled. Each configuration option allows you to modularly enable API methods that are responsible for sending custom information to New Relic.
Importante
All of these are set to false when the agent is in high-security mode.
This section defines the Node.js agent variables in the order they typically appear in the rules: { section of your app's newrelic.js configuration file.
A comma-delimited list of rules to match incoming request URLs and name the associated New Relic transaction. Uses the format:
name:[
{pattern:'STRING_OR_REGEX',name:'NAME'},
{pattern:'STRING_OR_REGEX',name:'NAME'}
]
Both parameters are required. For strings, you must escape control characters. You do not need to escape control characters in regular expressions. Additional attributes are ignored.
Regular expressions support JavaScript-style capture groups, and names use $1-style replacement strings. Regular expressions only find the first matching result; subsequent matches are ignored. For more information, see Node.js transaction naming API.
For the NEW_RELIC_NAMING_RULES environment variable, pass the rules as comma-delimited JSON object literals:
Define a list of request URLs you want the agent to ignore. Specify the list as patterns, which can be strings or regular expressions. The default value is a regular expression to match socket.io long-polling requests
When enabled, the agent renames transactions that are not affected by other naming logic (such as the API, rules, or metric normalization rules) to NormalizedUri/*. If you set this to false, the agent sets transaction names to Uri/path/to/resource.
Transaction events variables
This section defines the Node.js agent variables in the order they typically appear in the transaction_events: { section of your app's newrelic.js configuration file.
When enabled, the agent sends transaction events to New Relic. This event data includes transaction timing, transaction name, and any custom attributes. If this is disabled, the agent does not collect this data or send it to New Relic.
Defines the maximum number of events the agent collects per minute. If there are more than this number, the agent collects a statistical sampling.
We don't recommend configuring past 10,000. The server will cap data at 10,000 per-minute.
Importante
This configuration had different behavior in agent versions lower than 6.0.0. See max_samples_stored (DEPRECATED) for agent versions 5.x or lower.
Type
Integer
Default
20000
Defines the maximum number of events the agent stores if it is unable to communicate with the New Relic collector. The values from the previous harvest cycle will be merged into the next one, with this option limiting the maximum number. Make sure this number is greater than max_samples_per_minute; for example, set it to twice as much. Consider your memory overhead before increasing this value.
Advertencia
This configuration has different behavior starting with agent version 6.0.0 and a new recommended maximum. See max_samples_stored for agent versions 6.x or higher.
Type
Integer
Default
10000
Defines the maximum number of events the agent collects per minute. If there are more than this number, the agent collects a statistical sampling.
Advertencia
This configuration has been replaced with max_samples_stored starting with version 6.0.0 of the agent. See max_samples_stored for 6.x or later agents.
Prefix of attributes to include in transaction events. Allows * as wildcard at end.
Custom events variables
This section defines the Node.js agent variables in the order they typically appear in the custom_insights_events: { section of your app's newrelic.js configuration file.
When enabled, the agent sends custom events recorded with recordCustomEvent() to New Relic. If this is disabled, the agent does not collect this data or send it to New Relic.
Defines the maximum number of custom events the agent collects per minute. If the number of custom events exceeds this limit, the agent collects a statistical sampling.
When configuring the agent for AI monitoring, set to max value 100000. Ensures that the maximum amount of LLM events are captured.
Importante
Increasing this limit may increase memory usage.
Custom hostname variables
This section defines the Node.js agent variables in the order they typically appear in the process_host: { section of your app's newrelic.js configuration file. These options control behavior regarding the host display name in the APM UI.
Specify a custom hostname for display in New Relic. If you do not set this field, New Relic will continue to use the default hostname found by calling os.hostname().
If you use the default hostname settings, New Relic finds the hostname through os.hostname().
If this call fails, New Relic uses the host's IP as the name.
If you set ipv_preference: 4 or ipv_preference: 6, you can select the type of IP address (IPv4 or IPv6) that appears in the New Relic UI.
The Node.js agent variables that control error message redaction appear in the strip_exception_messages section of your app's newrelic.js configuration file:
Toggles whether to capture additional attributes on middleware spans for all Node.js web frameworks that help drive Code level metrics. The additional attributes are: code.filepath, code.function, code.lineno, and code.column.
Errors inbox configuration
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).
Specifies the regex flags to use for url obfuscation pattern matching e.g. g for global matching, i for case insensitive matching, etc. Multiple flags can be specified as a string e.g. gi. If this is not set, no flags will be used.
Specifies the replacement string to use for url obfuscation. Can contain refferences to capture groups in the pattern e.g. $1. If this is not set, everything will be replaced with a single empty string.
Toggles whether the New Relic Security agent data is sent to New Relic or not. When this is disabled and security.agent.enabled is true, the security agent be registered but data will not be sent.
New Relic Security provided mode: IAST. Default is IAST. Due to the invasive nature of IAST scanning, DO NOT enable this mode in either a production environment or an environment where production data is processed.
New Relic Security connection URL. This is the endpoint that the security agent sends data to, it should match that environment that you have set for the Node.js agent.
If true, the agent uses Heroku dyno names as the hostname.
Worker Threads
In agent versions prior to 11.0.0, the agent ran in both main and worker threads. In version 11.0.0 the agent stopped running in worker threads due to its incompatibility with our async context propagation. The ability to run in worker threads was restored in version 11.3.0 but you must set worker_threads.enabled to true. The behavior of running in the worker threads varies and we do not officially support it. Some things like metrics generation, and self contained transaction traces may work but this is a use at your own risk capability.
If true, the agent will load when in a worker thread if specified.
Utilization
Configure how the agent detects host and cloud environment information to accurately calculate your utilization-based pricing. These settings appear in the utilization section of your app's newrelic.js configuration file.
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.
When enabled, it will use the GCP metadata id to set the hostname of the running application (Services, Worker Pools, and Jobs).
OpenTelemetry
These settings govern the various OpenTelemetry-based features provided by the agent. They appear in the opentelemetry section of your app's newrelic.js configuration file.
Importante
This configuration is subject to change while the OpenTelemetry feature set is in development.
Global switch for the whole OpenTelemetry feature. If set to false, no other OpenTelemetry sub-feature (such as traces, logs, or metrics) will be enabled, regardless of that sub-feature's own setting.
When true, the agent automatically configures the OpenTelemetry metrics API to send metrics to New Relic, attached to the application entity instrumented by the agent.
The number of milliseconds between each attempt to ship OpenTelemetry metrics to New Relic. Must be greater than or equal to opentelemetry.metrics.export_timeout.
The number of milliseconds an OpenTelemetry metrics export operation is allowed before it must successfully complete. If the timeout is exceeded, it's reported via the OpenTelemetry diagnostics API.
Apollo Server instrumentation
These settings customize the behavior of the agent's Apollo Server (GraphQL) instrumentation. They appear in the apollo_server section of your app's newrelic.js configuration file.
Enables capture of timing for fields resolved with the GraphQLScalarType return type. This may be desired when performing time-intensive calculations to return a scalar value. Not recommended for queries that return a large number of pre-calculated scalar fields.
Sugerencia
Query/mutation resolvers are always captured, even when they return a scalar type.
Enables capture of metrics for every field and resolver argument seen for an Apollo query. Intended for identifying unused fields in your GraphQL schema.
Environment variable overrides
This section defines two configuration options only available with environment variables. These overrides are not used in most configurations.
Path to the directory containing newrelic.js. This is available only as an environment variable. You cannot set it in your config file.
Type
String
Default
(none)
Used to set a different config file name than the default newrelic.js. This is available only as an environment variable. You cannot set it in your config file.
Type
String
Default
(none)
If used, this prevents the agent from reading configuration settings from newrelic.js. Default values and values from environment variables will still be set.
This is available only as an environment variable. You cannot set it in your config file.
Type
Boolean
Default
false
Environment variable type reference guide
This section describes how to properly format the complex data types.
Array types are defined as comma-delimited strings.