---
title: Enabling and disabling attributes (Python)
source: https://docs.newrelic.com/docs/apm/agents/python-agent/attributes/enabling-disabling-attributes-python
---

This describes the configuration settings to enable or disable [Python agent attributes](https://docs.newrelic.com/docs/agents/python-agent/attributes/python-agent-attributes), and the rules that our agents use when determining which attributes to include or exclude for a [destination](https://docs.newrelic.com/docs/features/agent-attributes#destinations).

This also includes a summary of the Python agent configuration [settings that have been deprecated](#deprecated) with the release of agent attributes.

## Configuration settings [#configurationSettings]

Use the following destination settings to open or close the destination to any attribute collection:

**attributes.enabled**

| Type    | Boolean |
| ------- | ------- |
| Default | `true`  |

Turns on or turns off all attributes.

**transaction_tracer.attributes.enabled**

| Type    | Boolean |
| ------- | ------- |
| Default | `true`  |

Turns on or turns off all attributes for transaction traces. If `attributes.enabled` is `false`, no attributes will be sent to transaction traces regardless of how this configuration setting is set.

**error_collector.attributes.enabled**

| Type:    | Boolean |
| -------- | ------- |
| Default: | `true`  |

Turns on or turns off all attributes for traced errors. If `attributes.enabled` is `false`, no attributes will be sent to traced errors regardless of how this configuration setting is set.

**transaction_events.attributes.enabled**

| Type:    | Boolean |
| -------- | ------- |
| Default: | `true`  |

Turns on or turns off all attributes for transaction events. If `attributes.enabled` is `false`, no attributes will be sent to transaction events regardless of how this configuration setting is set.

**browser_monitoring.attributes.enabled**

| Type:    | Boolean |
| -------- | ------- |
| Default: | `false` |

Turns on or turns off all attributes for browser monitoring. This is the data that gets sent to the PageView destination. If `attributes.enabled` is `false`, no attributes will be sent to browser monitoring regardless of how this configuration setting is set.

Use the following attribute/destination specific `.include` or `.exclude` settings to add or remove specific attributes in specific destinations:

**attributes.include**

| Type:    | Space-Separated List of Strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

If attributes are enabled, all attribute keys in this list will be sent.

**attributes.exclude**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

All attribute keys in this list will **not** be sent.

**transaction_tracer.attributes.include**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

If attributes are enabled for transaction traces, all attribute keys in this list will be sent in transaction traces.

**transaction_tracer.attributes.exclude**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

All attribute keys in this list will **not** be sent in transaction traces.

**error_collector.attributes.include**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

If attributes are enabled for traced errors, all attribute keys in this list will be sent in traced errors.

**error_collector.attributes.exclude**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

All attribute keys in this list will **not** be sent in traced errors.

**transaction_events.attributes.include**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

If attributes are enabled for transaction events, all attribute keys in this list will be sent in transaction events.

**transaction_events.attributes.exclude**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

All attribute keys in this list will **not** be sent in transaction events.

**browser_monitoring.attributes.include**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

If attributes are enabled for `browser_monitoring`, all attribute keys in this list will be sent in page views.

**browser_monitoring.attributes.exclude**

| Type:    | Space-separated list of strings |
| -------- | ------------------------------- |
| Default: | (none)                          |

All attribute keys found in this list will **not** be sent in page views.

## Attribute rules [#attruls]

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

**Root level takes precedence for enabled.**

The `attributes.enabled` field trumps all other settings. When `false`, no attributes will be reported.

Example configuration:

````ini
attributes.enabled = false
attributes.include = foo bar
transaction_tracer.attributes.enabled = true
```

Example output:

```
Keys passed in: foo, bar, baz
Keys included for all destinations:
Keys excluded for all destinations: foo, bar, baz
```

````

**Destination enabled takes precedence over include and exclude.**

The `YOUR_DESTINATION.attributes.enabled` flags take precedence over include and exclude keys.

Example configuration:

````ini
transaction_tracer.attributes.enabled = false
attributes.include = one two
transaction_tracer.attributes.include = three four
```

Example output:

```
Keys passed in: one, two, three, four
Keys included for transaction traces:
Keys excluded for transaction traces: one, two, three, four
```

````

**Attribute is included if the destination is enabled.**

If a destination is enabled, all user attributes are sent to that destination by default.

All user attributes default to `true`. However, by default, request parameters are disabled for all destinations.

Example configuration:

````ini
attributes.enabled = true
attributes.exclude = baz
```

Example output:

```
Keys passed in: foo, bar, baz
Keys included:  foo, bar
Keys excluded:  baz
```

````

**Exclude always supersedes include.**

If the same key is listed in the include and exclude lists, then attributes with the specified key will be excluded.

Example configuration:

````ini
attributes.enabled = true
attributes.include = foo bar
attributes.exclude = nerd bar
```

Example output:

```
Keys passed in: foo, bar, nerd
Keys included:  foo
Keys excluded:  nerd, bar
```

````

**Keys are case sensitive.**

Keys are case-sensitive.

Example configuration:

````ini
attributes.enabled = true
attributes.exclude = username UsErNaMe
```

Example output:

```
Keys passed in: username, Username, USERNAME, UsErNaMe, userNAME
Keys included:  Username, USERNAME, userNAME
Keys excluded:  username, UsErNaMe
```

````

**Use `\*` 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.

Example configuration:

````ini
attributes.enabled = true
attributes.include = custom*
attributes.exclude = request.parameters.*
```

Example output:

```
Keys passed in: custom, custom.key1, custom.key2, request.parameters., request.parameters.foo, request.parameters.bar
Keys included:  custom, custom.key1, custom.key2
Keys excluded:  request.parameters., request.parameters.foo, request.parameters.bar
```

````

**Most specific setting for a key takes priority.**

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

Example configuration:

````ini
attributes.enabled = true
attributes.include = request.parameters.foo
attributes.exclude = request.parameters.*
```

Example output:

```
Keys passed in: request.parameters., request.parameters.foo, request.parameters.bar
Keys included:  request.parameters.foo
Keys excluded:  request.parameters., request.parameters.bar
```

````

**Include or exclude affects the specific destination.**

If the attribute include or exclude is specified on a destination, then it only impacts that destination.

Example configuration:

````ini
attributes.include = foo
transaction_events.attributes.exclude = foo
```

Example output:

```
Keys passed in: foo
Keys included for transaction events: 
Keys included for other destinations: foo
Keys excluded for transaction events: foo
```

````

## Deprecated configuration settings [#deprecated]

The following configuration settings have been deprecated. Switch to the new attributes configuration for these settings when upgrading your Python agent.

| **Deprecated setting**                                    | **New setting**                                                                                                                                                                                                                            |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `capture_params`                                          | `attributes.include = request.parameters.*` By default, request parameters are not sent. Add `request.parameters.*` to the `attributes.include` list to turn on all request parameters. The `capture_params` property has been deprecated. |
| `ignored_params`                                          | `attributes.exclude = request.parameters.{name}` Add each request parameter key to the `attributes.exclude` list. Be sure to prepend the key with `request.parameters`. The `ignored_params` property has been deprecated.                 |
| `analytics_events.enabled`                                | `transaction_events.enabled`                                                                                                                                                                                                               |
| `analytics_events.capture_attributes`                     | `transaction_events.attributes.enabled`                                                                                                                                                                                                    |
| `analytics_events.max_samples_stored`                     | `transaction_events.max_samples_stored`                                                                                                                                                                                                    |
| `browser_monitoring.capture_attributes`                   | `browser_monitoring.attributes.enabled`                                                                                                                                                                                                    |
| `error_collector.capture_attributes`                      | `error_collector.attributes.enabled`                                                                                                                                                                                                       |
| `event_harvest_config.harvest_limits.analytic_event_data` | `transaction_events.max_samples_stored`                                                                                                                                                                                                    |
| `event_harvest_config.harvest_limits.custom_event_data`   | `custom_insights_events.max_samples_stored`                                                                                                                                                                                                |
| `event_harvest_config.harvest_limits.error_event_data`    | `error_collector.max_event_samples_stored`                                                                                                                                                                                                 |
| `event_harvest_config.harvest_limits.log_event_data`      | `application_logging.forwarding.max_samples_stored`                                                                                                                                                                                        |
| `event_harvest_config.harvest_limits.span_event_data`     | `span_events.max_samples_stored`                                                                                                                                                                                                           |
| `transaction_events.capture_attributes`                   | `transaction_events.attributes.enabled`                                                                                                                                                                                                    |
| `transaction_tracer.capture_attributes`                   | `transaction_tracer.attributes.enabled`                                                                                                                                                                                                    |
