---
title: Java agent attributes settings
source: https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-attributes-settings
---

Attributes settings control which attributes the agent collects and attaches to transactions, errors, traces, and events.

> #### 💡 TIP
>
> Back to the full settings index: [Java agent configuration](https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-config-file)

## Attributes [#attributes]

To set these options, use the `attributes` section. To [override](https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-config-file#System_Properties) them, use a `newrelic.config.attributes` prefixed system property.

Attributes are key-value pairs related to transaction traces, traced errors, browser monitoring, and transaction events. There's an `attribute` section under each destination. For more information, see [Java agent attributes](https://docs.newrelic.com/docs/apm/agents/java-agent/attributes/java-agent-attributes), [Enabling and disabling attributes](https://docs.newrelic.com/docs/apm/agents/java-agent/attributes/java-agent-attributes) and [Attribute examples](https://docs.newrelic.com/docs/apm/agents/java-agent/attributes/java-agent-attributes).

**enabled**

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

This setting can be used to turn on or off all attributes.
For security reasons, capturing custom attributes using the Custom Instrumentation Editor is set to false by default.


**include**

| Type    | List of Strings |
| ------- | --------------- |
| Default | (none)          |

If attributes are enabled, attribute keys found in this list will be sent to New Relic. Separate the keys in the list with a comma; for example:

````
key1, key2, key3
```

Also refer to the [agent attribute rules](/docs/subscriptions/agent-attributes).

````

**exclude**

| Type    | List of Strings |
| ------- | --------------- |
| Default | (none)          |

All attribute keys found in this list will not be sent to New Relic. Separate the keys in the list with a comma; for example:

````
key1, key2, key3
```

Also refer to the [agent attribute rules](/docs/subscriptions/agent-attributes).

````

**http_attribute_mode**

| Type    | String |
| ------- | ------ |
| Default | both   |

Attribute reporting is configurable via the following means.

YAML:

````yml
attributes:
  http_attribute_mode: both
```

System property:

```properties
-Dnewrelic.config.attributes.http_attribute_mode=both
```

Environment variable:

```properties
NEW_RELIC_ATTRIBUTES_HTTP_ATTRIBUTE_MODE=both
```

The configuration options are:

* `standard` : Reporting will utilize standard (i.e. OTEL) Attributes. This configuration is encouraged. It will minimize impact to functionality and maintain the lowest level of ingest for attribute reporting.
* `legacy` : Reporting will be done by the reintroduced HTTP Attributes, this configuration may impact current or future functionality.
* `both` : This is the default configuration, reporting will be done by the reintroduced HTTP Attributes and the OTEL Attributes. This configuration will also increase your data ingest.

<Callout variant="important">
  Available since [Java agent version 8.8.0](/docs/release-notes/agent-release-notes/java-release-notes/java-agent-880). The default configuration, `both`, will increase data ingest. To avoid an increase in data ingest, you must override the default by setting `http_attribute_mode` to `legacy` or `standard`.
</Callout>

````
