This page covers the Node.js agent settings for error collection, including which HTTP status codes and error classes to ignore or mark as expected, and how many error events to sample per minute.
Sugerencia
Back to the full settings index: Node.js agent configuration
Error collector variables
You can manage how error are handled in New Relic. This section defines the Node.js agent variables in the order they typically appear in the error_collector: { section of your app's newrelic.js configuration file.
Type | Boolean |
|---|---|
Default |
|
| |
|
When enabled, the agent collects error traces from your app.
Type | Array of Integers |
|---|---|
Default |
|
| |
|
Comma-delimited list of HTTP status codes for the error collector to ignore.
Advertencia
Errors recorded using newrelic.noticeError() do not obey this configuration value.
Type | Array|Object |
|---|---|
Default |
|
|
Comma-delimited list of javascript error types/classes for the error collector to ignore.
The following configuration
error_collector: { /* ... */ ignore_classes: ["ReferenceError"]}Would ignore all reference errors.
Advertencia
Errors recorded using newrelic.noticeError() do not obey this configuration value.
Type | Object |
|---|---|
Default |
|
|
A JavaScript object describing a list of classes tied to error messages for the collector to ignore. The following configuration would ignore all errors of the type Error with the exact (case-sensitive) message strings of Undefined and Out of time:
error_collector: { /* ... */ ignore_messages: {"Error":["Undefined", "Out of time"]}}Would ignore all errors of type Error, with the exact (case-sensitive) message strings of Undefined and Out of time.
Advertencia
Errors recorded using newrelic.noticeError() do not obey this configuration value.
Type | Array of integers |
|---|---|
Default |
|
|
Comma-delimited list of HTTP status codes for the error collector to mark as expected.
Advertencia
Errors recorded using newrelic.noticeError() do not obey this configuration value.
Type | Array |
|---|---|
Default |
|
|
The following configuration
error_collector: { /* ... */ expected_classes: ["ReferenceError"]}Would mark all reference errors as expected.
Advertencia
Errors recorded using newrelic.noticeError() do not obey this configuration value.
Type | Object |
|---|---|
Default |
|
|
A javascript object describing a list of javascript classes tied to javascript error messages for the collector to ignore. The following configuration.
error_collector: { /* ... */ expected_messages: {"Error":["Undefined", "Out of time"]}}Would mark all errors of type Error, with the exact (case-sensitive) message strings of Undefined and Out of time.
Advertencia
Errors recorded using newrelic.noticeError() do not obey this configuration value.
Type | Boolean |
|---|---|
Default |
|
|
If true, the agent captures attributes from error collection.
Advertencia
Any header-related include/exclude rules must be in camelCase form to be filtered.
Type | Array |
|---|---|
Default |
|
|
Prefix of attributes to exclude from error collection. Allows * as wildcard at end.
Type | Array |
|---|---|
Default |
|
|
Prefix of attributes to include in error collection. Allows * as wildcard at end.
Type | Integer |
|---|---|
Default |
|
|
Defines the maximum number of events the agent collects per minute. If there are more than this number, the agent collects a statistical sampling.