---
title: Enable and disable attributes (.NET)
source: https://docs.newrelic.com/docs/apm/agents/net-agent/attributes/enable-disable-attributes-net
---

This describes the rules New Relic uses to determine 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 .NET agent properties that were no longer available with the release of New Relic agent attributes in versions 9.0 or higher.

## Attribute rules [#attruls]

New Relic follows these rules to determine which attributes to include or exclude:

**Root level takes precedence for enabled.**

The `attributes.enabled` field overrides all other settings. When `false`, no attributes will be reported to New Relic.

Example configuration:

````xml
<attributes enabled="false">
  <include>foo</include>
  <include>bar</include>
</attributes>
<transactionTracer enabled="true">
  <attributes enabled="true"/>
</transactionTracer>
```

Example output:

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

````

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

The `{destination}.attributes.enabled` flags take precedence over include and exclude keys.

Example configuration:

````xml
<attributes enabled="true">
  <include>one</include>
  <include>two</include>
</attributes>
<transactionTracer enabled="true">
  <attributes enabled="false">
    <include>three</include>
    <include>four</include>
  </attributes>
</transactionTracer>
```

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 attributes and message parameters are disabled for all destinations.

Example configuration:

````xml
<attributes enabled="true">
  <exclude>myAttKey</exclude>
</attributes>
```

Example output:

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

````

**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:

````xml
<attributes enabled="true">
  <include>foo</include>
  <include>myCustomAtt</include>
  <exclude>password</exclude>
  <exclude>myCustomAtt</exclude>
</attributes>
```

Example output:

```
Keys passed in: foo, myCustomAtt, password
Keys included: foo
Keys excluded: password, myCustomAtt
```

````

**Keys are case sensitive.**

Keys are case sensitive.

Example configuration:

````xml
<attributes enabled="true">
  <exclude>password</exclude>
  <exclude>PaSsWoRd</exclude>
</attributes>
```

Example output:

```
Keys passed in: password, Password, PASSWORD, PaSsWoRd, PassWORD
Keys included: Password, PASSWORD, PassWORD
Keys excluded: password, PaSsWoRd
```

````

**Use an asterisk `*` for wildcards.**

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

Example configuration:

````xml
<attributes enabled="true">
  <include>custom*</include>
  <exclude>request.parameters.*</exclude>
</attributes>
```

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:

````xml
<attributes enabled="true">
  <include>request.parameters.foo</include>
  <exclude>request.parameters.*</exclude>
</attributes>
```

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:

````xml
<attributes enabled="true">
  <include>foo</include>
</attributes>
<transactionEvents enabled="true">
  <attributes enabled="true">
    <exclude>foo</exclude>
  </attributes>
</transactionEvents>
```

Example output:

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

````

## Obsolete properties [#deprecated]

The following properties are not available in the .NET agent v9.0. Please visit the [.NET agent 8.x to 9.x migration guide](https://docs.newrelic.com/docs/agents/net-agent/getting-started/8x-to-9x-agent-migration-guide) page for replacement properties when upgrading your .NET agent.

**analyticsEvents replaced by transactionEvents**

The `analyticsEvents` element in **newrelic.config** is obsolete. Enable the [`transactionEvents`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#transaction_events) element in **newrelic.config**:

````xml
<transactionEvents enabled="true"/>
```

````

**requestParameters replaced by request.parameters.\***

By default, request parameters are not sent to New Relic. Add `request.parameters.*` to the `attributes.include` list to enable request parameter collection.

````xml
<attributes>
  <include>request.parameters.*</include>
</attributes>
```

````

**parameterGroups: enable and ignore replaced by attributes true, include and exclude**

The `parameterGroups` value and its `enabled` and `ignore` settings are obsolete. By default, `customParameters` and `responseHeaderParameters` are instrumented, while `serviceRequestParameters` are not instrumented. To customize these settings:

-   Use the [`enabled`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#agent-attributes-enabled) flag to enable instrumentation.
-   Use [`include`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#agent-attributes-include) and [`exclude`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#agent-attributes-exclude) to toggle instrumentation for specific attributes.

    For example:

    ```xml
    <attributes enabled="true">
      <include>service.request.*</include>
      <exclude>response.headers.*</exclude>
      <exclude>myCustomApiKey.*</exclude>
    </attributes>
    ```

    For more information on configuring attributes, see the [attributes examples](https://docs.newrelic.com/docs/agents/net-agent/attributes/net-attribute-examples).

**captureAttributes flag replaced by attributes sub-elements**

The capture attributes flag on `browserMonitoring`, `transactionTracer`, `transactionEvents`, and `errorCollector` is obsolete. Instead, use the `attributes` sub-element to configure attribute settings for each of these destinations.

| **New property**                                                                                                                             | **Example**                                                                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`browserMonitoring`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#browser-attributes) | ````xml <browserMonitoring enabled="true">   <attributes enabled="false">     <include>myKey.*</include>     <exclude>myKey.foo</exclude>   </attributes> </browserMonitoring> ```  ```` |
| [`transactionTracer`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#tracer-attributes)  | ````xml <transactionTracer enabled="true">   <attributes enabled="false">     <include>myKey.*</include>     <exclude>myKey.foo</exclude>   </attributes> </transactionTracer> ```  ```` |
| [`transactionEvents`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#paragrp-attributes) | ````xml <transactionEvents enabled="true">   <attributes enabled="false">     <include>myKey.*</include>     <exclude>myKey.foo</exclude>   </attributes> </transactionEvents> ```  ```` |
| [`errorCollector`](https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#error-attributes)      | ````xml <errorCollector enabled="true">   <attributes enabled="false">     <include>myKey.*</include>     <exclude>myKey.foo</exclude>   </attributes> </errorCollector>> ```  ````      |
