---
title: Node.js agent attributes
source: https://docs.newrelic.com/docs/apm/agents/nodejs-agent/attributes/nodejs-agent-attributes
---

This document describes the New Relic Node.js agent [attributes](https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/agent-attributes), details how to enable or disable attributes, and describes the rules the agent follows to determine which attributes to include or exclude for a [destination](https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/agent-attributes#destinations).

> #### 💡 TIP
>
> These attribute settings apply to Node.js agent version 2.7.1 or higher. If you use an older version of the agent, see [Update legacy attribute configuration](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/upgrade-nodejs-agent).

## Find and use attributes [#location]

New Relic [attributes](https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/agent-attributes) are key-value pairs containing information that determines the properties of [event](https://docs.newrelic.com/docs/accounts-partnerships/getting-started-new-relic/glossary#event) and [transaction](https://docs.newrelic.com/docs/accounts-partnerships/getting-started-new-relic/glossary#transaction) data. Attributes can help you gain greater insight into your application and annotate the data in [New Relic](https://docs.newrelic.com/docs/insights/use-insights-ui/getting-started/introduction-new-relic-insights).

Attributes (both default and [custom](https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/collect-custom-attributes)) can be found in:

-   APM [transaction traces](https://docs.newrelic.com/docs/apm/transactions/transaction-traces/introduction-transaction-traces) and [error analytics](https://docs.newrelic.com/docs/apm/applications-menu/error-analytics/introduction-error-analytics)
-   [APM events](https://docs.newrelic.com/docs/insights/explore-data/attributes/apm-default-attributes-insights)
-   [Browser events](https://docs.newrelic.com/docs/insights/explore-data/attributes/browser-default-attributes-insights#browser-attributes-table)

You can customize exactly which attributes will be sent to each of these destinations.

> #### 💡 TIP
>
> As of Node.js agent version 6.10.0, when you enable distributed tracing and/or Infinite Tracing, information from `Transaction` events is applied to the currently available `Span` of the transaction. Because of this, you may want to apply the attribute settings for `Transaction` events to `Span` events or apply them as global attribute settings.

## Node.js-specific attributes [#attributes]

In addition to the [default APM attributes](https://docs.newrelic.com/docs/insights/new-relic-insights/decorating-events/apm-default-attributes-insights#transaction-event), the Node.js agent collects attributes from these sources:

**HTTP response codes**

The response status code for a web request. The key for this attribute is `httpResponseCode`.

The default setting for each destination is:

-   Transaction traces: Enabled
-   Error analytics: Enabled
-   APM events: Enabled
-   Browser events: Disabled

    **Note:** The `httpResponseCode` attribute (string value) is removed as of agent version 7.0.0. `http.statusCode` (integer value) should be used instead.

**HTTP response messages**

The response status message if present for a web request. The key for this attribute is `httpResponseMessage`.

The default setting for each destination is:

-   Transaction traces: Enabled
-   Error analytics: Enabled
-   APM events: Enabled
-   Browser events: Disabled

    **Note:** The `httpResponseMessage` attribute (string value) is removed as of agent version 7.0.0. `http.statusText` (string value) should be used instead.

**Custom attributes**

Attributes added to an [`addCustomAttribute()`](https://newrelic.github.io/node-newrelic/API.html#addCustomAttribute) call to the Node.js agent API. The key name for this attribute depends on what you specify when you call the method.

The default setting for each destination is:

-   Transaction traces: Enabled
-   Error analytics: Enabled
-   APM events: Enabled
-   Browser events: Disabled

    > #### ⚠️ IMPORTANT
    >
    > Before creating custom attributes, review New Relic's list of [reserved terms used by NRQL](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits#reserved-words). Otherwise unexpected results may occur.

**`noticeError()` API calls**

Attributes added to a [`noticeError()`](https://newrelic.github.io/node-newrelic/API.html#noticeError) call on the Node.js agent API. The key name for this attribute depends on what you specify when you call the method.

The default setting for each destination is:

-   Transaction traces: Unavailable
-   Error analytics: Enabled
-   APM events: Unavailable
-   Browser events: Unavailable

**Request and response headers**

The Node.js agent can capture response and request headers as attributes. By default, the Node.js agent will collect all request headers that are not excluded.

Excluded HTTP request headers by default:

-   `request.headers.cookie`

-   `request.headers.authorization`

-   `request.headers.proxy-authorization`

-   `request.headers.set-cookie*`

-   `request.headers.x-*`

    Captured response header: `response.headers.content-type`

    You can disable collecting all the headers by setting `allow_all_headers` to `false` in your `newrelic.js` file.

    The default setting for each destination is:

-   Transaction traces: Enabled

-   Error analytics: Enabled

-   APM events: Enabled

-   Browser events: Disabled

**Request parameters**

Request parameters from the transaction. The Node.js agent does not capture parameters by default. All GET parameters can be captured if the `request.parameters.*` entry is added to [`attributes.include`](#cfg-attributes-include), or specific request parameters can be added to the list, for example, `request.parameters.foo` or `request.parameters.bar`. In order to capture POST parameters, use the [`addCustomAttribute()`](https://newrelic.github.io/node-newrelic/API.html#addCustomAttribute) Node.js agent API call.

## Configure attributes

You can customize what types of attributes the Node.js agent sends to each destination. This is most common for security reasons, when you have certain sensitive attributes you do not want reported to New Relic.

Use the following configuration properties along with the [attribute rules](#attruls) to enable or disable attributes:

**allow_all_headers**

Disabled by default. Set this to `true` for the agent to only collect all headers, except those filtered by `exclude` rules.

**attributes.include_enabled**

Enabled by default. Set this to `false` to disable the [`attributes.include`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#attributes_include) array.

**destination.attributes.enabled**

| Destination        | Configuration option                                                                                                                                                  | Default |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| All                | [`attributes.enabled`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#attributes_enabled)                   | True    |
| Transaction traces | [`transaction_tracer.attributes.enabled`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#tracer_enabled)    | True    |
| Error analytics    | [`error_collector.attributes.enabled`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#error_collector)      | True    |
| APM events         | [`transaction_events.attributes.enabled`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#tx_events_enabled) | True    |
| Browser events     | [`browser_monitoring.attributes.enabled`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#browser)           | False   |

Enable or disable attributes entirely. If you set a destination to `false`, no attributes will be sent to that destination regardless of your include/exclude settings. If a destination is enabled, all user attributes are sent to that destination by default.

**destination.attributes.include**

| Destination        | Configuration option                                                                                                                                                        | Default |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| All                | [`attributes.include`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#attributes_include)                         | (none)  |
| Transaction traces | [`transaction_tracer.attributes.include`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#hide-attributes-include) | (none)  |
| Error analytics    | [`error_collector.attributes.include`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#error_attributes_include)   | (none)  |
| APM events         | [`transaction_events.attributes.include`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#tx-attributes-include)   | (none)  |
| Browser events     | [`browser_monitoring.attributes.include`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#browser-debug-include)   | (none)  |

Specify particular attribute keys you want the agent to report to New Relic. For all destinations, this is a list of strings that is empty by default. The `.exclude` properties override the `.include` properties. To disable all `.include` values, set [`attributes.include_enabled`](#cfg-attributes-include-enabled) to `false`.

**destination.attributes.exclude**

| Destination        | Configuration option                                                                                                                                                        | Default |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| All                | [`attributes.exclude`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#attributes_exclude)                         | (none)  |
| Transaction traces | [`transaction_tracer.attributes.exclude`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#hide-attributes-exclude) | (none)  |
| Error analytics    | [`error_collector.attributes.exclude`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#error_attributes_exclude)   | (none)  |
| APM events         | [`transaction_events.attributes.exclude`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#tx-attributes-exclude)   | (none)  |
| Browser events     | [`browser_monitoring.attributes.exclude`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#browser-debug-exclude)   | (none)  |

Specify particular attribute keys you do not want the agent to report to New Relic. For all destinations this is a list of strings that is empty by default. The `.exclude` properties override the `.include` properties.

## Attribute rules [#attruls]

The Node.js agent follows these rules when determining which attributes to include or exclude for a destination:

**Setting attributes.enabled to false overrides all other settings.**

If you set the main [`attributes.enabled`](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#attributes_enabled) property to `false`, the agent does not report any attributes at all.

**Disable all attributes**

Agent configuration:

-   `attributes.enabled: false`

-   `attributes.include: request.parameters.*`

-   `error_collector.attributes.enabled: true`

    Input keys:

-   `foo`

-   `bar`

-   `request.parameters.foo`

-   `request.parameters.bar`

    Agent output:

-   Transaction traces: No attributes

-   Error analytics: No attributes

-   APM events: No attributes

-   Browser events: No attributes

**Setting a destination to false overrides include/exclude.**

When you set [enabled](#cfg-attributes-enabled) to `false` for a destination, the agent ignores your include/exclude settings and not report any attributes for that destination.

**Disable one destination**

Agent configuration:

-   `transaction_tracer.attributes.enabled: false`

-   `attributes.include: one, two*`

-   `transaction_tracer.attributes.include: three, four`

    Input keys:

-   `one`

-   `two`

-   `three`

-   `four`

    Agent output:

-   Transaction traces: No attributes

-   Error analytics: `one`, `two`

-   APM events: `one`, `two`

-   Browser events: No attributes

**Exclude overrides include.**

The `.exclude` properties override the `.include` properties.

**Conflict between include and exclude settings**

Agent configuration:

-   `attributes.enabled: true`

-   `attributes.include: foo, myCustomAtt`

-   `attributes.exclude: password, myCustomAtt`

    Input keys:

-   `foo`

-   `myCustomAtt`

-   `password`

    Agent output:

-   Transaction traces: `foo`

-   Error analytics: `foo`

-   APM events: `foo`

-   Browser events: `foo`

**More specific rules take priority.**

If multiple include or exclude attributes affect the same key, the most specific setting will have priority.

**Conflicts with specific settings**

Agent configuration:

-   `attributes.enabled: true`

-   `attributes.include: foo, myCustomAtt`

-   `attributes.exclude: password, myCustomAtt`

-   `browser_monitoring.attributes.enabled: true`

    Input keys:

-   `food`

-   `food.bread`

-   `food.fruit.banana`

-   `food.fruit.apple`

    Agent output:

-   Transaction traces: `food.fruit.apple`

-   Error analytics: `food.fruit.banana`, `food.fruit.apple`

-   APM events: `food.fruit.banana`, `food.fruit.apple`

-   Browser events: `food.fruit.banana`, `food.fruit.apple`

**Keys are case-sensitive.**

The keys specified in the `.include` and `.exclude` properties are case-sensitive.

**Keys do not match the specified case**

Agent configuration:

-   `attributes.enabled: true`

-   `attributes.exclude: password, PaSsWoRd`

    Input keys:

-   `password`

-   `Password`

-   `PASSWORD`

-   `PaSsWoRd`

-   `PassWORD`

    Agent output:

-   Transaction traces: `Password`, `PASSWORD`, `PassWORD`

-   Error analytics: `Password`, `PASSWORD`, `PassWORD`

-   APM events: `Password`, `PASSWORD`, `PassWORD`

-   Browser events: `Password`, `PASSWORD`, `PassWORD`

**Use an asterisk for wildcards.**

You can use an asterisk `*` at the end of a key as a wildcard. This will match a set of attributes with the same prefix.

**Wildcard matches multiple input keys**

Agent configuration:

-   `attributes.enabled: true`

-   `attributes.include: custom*`

-   `attributes.exclude: request.parameters.*`

    Input keys:

-   `custom`

-   `custom.key1`

-   `custom.key2`

-   `request.parameters.`

-   `request.parameters.foo`

-   `request.parameters.bar`

    Agent output:

-   Transaction traces: `custom`, `custom.key1`, `custom.key2`

-   Error analytics: `custom`, `custom.key1`, `custom.key2`

-   APM events: `custom`, `custom.key1`, `custom.key2`

-   Browser events: `custom`, `custom.key1`, `custom.key2`
