> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Java configuration options

AppSignal for Java can be configured through OpenTelemetry resource attributes.

Resource attributes are attributes that apply that every trace reported from the application using OpenTelemetry.

These resource attributes should be configured in your application using environment variables, where you also configure the OpenTelemetry exporter to export to the [AppSignal collector](/java/installation).

To configure the resource attributes, set an `OTEL_RESOURCE_ATTRIBUTES` environment variable, as shown below:

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  attribute_key=attribute_value,\
  ...,\
	last_attribute_key=last_attribute_value"
```

## Available options

* Required options
  * [`environment`](#option-environment)
  * [`host.name`](#option-host.name)
  * [`language_integration`](#option-language_integration)
  * [`name`](#option-name)
  * [`push_api_key`](#option-push_api_key)
  * [`revision`](#option-revision)
  * [`service.name`](#option-service.name)
* Options
  * [`app_path`](#option-app_path)
  * [`filter_attributes`](#option-filter_attributes)
  * [`filter_function_parameters`](#option-filter_function_parameters)
  * [`filter_request_payload`](#option-filter_request_payload)
  * [`filter_request_query_parameters`](#option-filter_request_query_parameters)
  * [`filter_request_session_data`](#option-filter_request_session_data)
  * [`ignore_actions`](#option-ignore_actions)
  * [`ignore_errors`](#option-ignore_errors)
  * [`ignore_logs`](#option-ignore_logs)
  * [`ignore_namespaces`](#option-ignore_namespaces)
  * [`request_headers`](#option-request_headers)
  * [`response_headers`](#option-response_headers)
  * [`send_function_parameters`](#option-send_function_parameters)
  * [`send_request_payload`](#option-send_request_payload)
  * [`send_request_query_parameters`](#option-send_request_query_parameters)
  * [`send_request_session_data`](#option-send_request_session_data)

## environment

<a id="option-environment" />

| Field                  | Value                          |
| ---------------------- | ------------------------------ |
| Resource attribute key | `appsignal.config.environment` |
| Required               | yes                            |
| Type                   | `String`                       |
| Default value          | nil (This is unset by default) |

### Description

The environment of the app to be reported to AppSignal.

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.environment=production,\
  ..."
```

<Note>
  **Note**: Changing the [name](#option-name) or environment of an existing app
  will create a new app on AppSignal.com.
</Note>

## host.name

<a id="option-host.name" />

| Field                  | Value                |
| ---------------------- | -------------------- |
| Resource attribute key | `host.name`          |
| Required               | yes                  |
| Type                   | `String`             |
| Default value          | detected from system |

### Description

The `host.name` resource attribute helps AppSignal recognize different hosts for traces and tag the traces automatically with the hostname.

```bash Shell theme={null}
HOST_NAME=$(hostname || echo unknown)

export OTEL_RESOURCE_ATTRIBUTES="\
  host.name=$HOST_NAME,\
  ..."
```

## language\_integration

<a id="option-language_integration" />

| Field                  | Value                                   |
| ---------------------- | --------------------------------------- |
| Resource attribute key | `appsignal.config.language_integration` |
| Required               | yes                                     |
| Type                   | `String`                                |
| Default value          | nil (This is unset by default)          |

### Description

AppSignal uses the `language_integration` resource attribute to detect the language of a trace and correctly parse exception backtraces.

To set this option, specify the language name in lowercase format: `java`.

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.language_integration=java,\
  ..."
```

## name

<a id="option-name" />

| Field                  | Value                          |
| ---------------------- | ------------------------------ |
| Resource attribute key | `appsignal.config.name`        |
| Required               | yes                            |
| Type                   | `String`                       |
| Default value          | nil (This is unset by default) |

### Description

Name of your application as it should be displayed on AppSignal.com.

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.name=My awesome app,\
  ..."
```

<Note>
  **Note**: Changing the name or [environment](#option-env) of an existing app
  will create a new app on AppSignal.com.
</Note>

## push\_api\_key

<a id="option-push_api_key" />

| Field                  | Value                           |
| ---------------------- | ------------------------------- |
| Resource attribute key | `appsignal.config.push_api_key` |
| Required               | yes                             |
| Type                   | `String`                        |
| Default value          | nil (This is unset by default)  |

### Description

The organization-level authentication key to authenticate with our Push API.

Read more about the [AppSignal Push API key](/appsignal/terminology#push-api-key).

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.push_api_key=00000000-0000-0000-0000-000000000000,\
  ..."
```

## revision

<a id="option-revision" />

| Field                  | Value                          |
| ---------------------- | ------------------------------ |
| Resource attribute key | `appsignal.config.revision`    |
| Required               | yes                            |
| Type                   | `String`                       |
| Default value          | nil (This is unset by default) |

### Description

Set the app revision to report the currently running version of your app. AppSignal will create a deploy marker when this value changes, and tag all incoming data with the current revision.

Read more about deploy markers in the [deploy markers topic](/application/markers/deploy-markers).

```bash Shell theme={null}
REVISION=$(git rev-parse --short HEAD 2>/dev/null || echo unknown)

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.revision=$REVISION,\
  ..."
```

## service.name

<a id="option-service.name" />

| Field                  | Value                          |
| ---------------------- | ------------------------------ |
| Resource attribute key | `service.name`                 |
| Required               | yes                            |
| Type                   | `String`                       |
| Default value          | nil (This is unset by default) |

### Description

The `service.name` resource attribute helps AppSignal recognize different services for traces and groups the traces automatically in a namespace based on the service name.

Choose a name that fits your application, like "Web server", "Background worker", "Email service", "Authentication service", etc.

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  service.name=My service name,\
  ..."
```

## app\_path

<a id="option-app_path" />

| Field                  | Value                          |
| ---------------------- | ------------------------------ |
| Resource attribute key | `appsignal.config.app_path`    |
| Required               | no                             |
| Type                   | `String`                       |
| Default value          | nil (This is unset by default) |

### Description

The location of the app on the host's file system.

The `app_path` resource attribute helps AppSignal clean up backtraces by stripping away the absolute app path of backtrace lines. This way only paths within the context of the project directory is shown. This makes our [Backtrace links](/application/backtrace-links) feature possible.

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.app_path=$PWD,\
  ..."
```

## filter\_attributes

<a id="option-filter_attributes" />

| Field                  | Value                                |
| ---------------------- | ------------------------------------ |
| Resource attribute key | `appsignal.config.filter_attributes` |
| Required               | no                                   |
| Type                   | `list(String)`                       |
| Default value          | `[]`                                 |

### Description

The `filter_attributes` resource attribute allows you to filter out specific attributes from being reported to AppSignal. This can be useful to filter out sensitive or non-relevant information from being reported.

If an attribute is filtered out this way, it will not show up in the interface at all.

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.filter_attributes=$(encode "my.secret.attribute,some.opentelemetry.attribute"),\
  ..."
```

## filter\_function\_parameters

<a id="option-filter_function_parameters" />

| Field                  | Value                                         |
| ---------------------- | --------------------------------------------- |
| Resource attribute key | `appsignal.config.filter_function_parameters` |
| Required               | no                                            |
| Type                   | `list(String)`                                |
| Default value          | `[]`                                          |

### Description

This resource attribute allows you to filter out any function parameters set in the [`appsignal.function.parameters` span attribute](/guides/custom-data/function-parameters).

In the example below, values for the keys listed in the `filter_function_parameters` config option are replaced with `[FILTERED]`.

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.filter_function_parameters=$(encode "api_token,secret"),\
  ..."
```

## filter\_request\_payload

<a id="option-filter_request_payload" />

| Field                  | Value                                     |
| ---------------------- | ----------------------------------------- |
| Resource attribute key | `appsignal.config.filter_request_payload` |
| Required               | no                                        |
| Type                   | `list(String)`                            |
| Default value          | `[]`                                      |

### Description

This resource attribute allows you to filter out any request payload data set in the [`appsignal.request.payload` span attribute](/guides/custom-data/request-parameters).

In the example below, values for the keys listed in the `filter_request_payload` config option are replaced with `[FILTERED]`.

Read more about [request query parameter filtering](/application/parameter-filtering).

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.filter_request_payload=$(encode "password,cvv"),\
  ..."
```

## filter\_request\_query\_parameters

<a id="option-filter_request_query_parameters" />

| Field                  | Value                                              |
| ---------------------- | -------------------------------------------------- |
| Resource attribute key | `appsignal.config.filter_request_query_parameters` |
| Required               | no                                                 |
| Type                   | `list(String)`                                     |
| Default value          | `[]`                                               |

### Description

This resource attribute allows you to filter out any request query parameters set in the [`appsignal.request.query_parameters` span attribute](/guides/custom-data/request-parameters).

In the example below, values for the keys listed in the `filter_request_query_parameters` config option are replaced with `[FILTERED]`.

Read more about [request query parameter filtering](/application/parameter-filtering).

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.filter_request_query_parameters=$(encode "password,cvv"),\
  ..."
```

## filter\_request\_session\_data

<a id="option-filter_request_session_data" />

| Field                  | Value                                          |
| ---------------------- | ---------------------------------------------- |
| Resource attribute key | `appsignal.config.filter_request_session_data` |
| Required               | no                                             |
| Type                   | `list(String)`                                 |
| Default value          | `[]`                                           |

### Description

The `filter_request_session_data` resource attribute allows you to filter out any request session data set in the [`appsignal.request.session_data` span attribute](/guides/custom-data/request-session-data).

In the example below, values for the keys listed in the `filter_request_session_data` config option are replaced with `[FILTERED]`.

Read more about [request session data filtering](/application/session-data-filtering).

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.filter_session_data=$(encode "password,cvv"),\
  ..."
```

## ignore\_actions

<a id="option-ignore_actions" />

| Field                  | Value                             |
| ---------------------- | --------------------------------- |
| Resource attribute key | `appsignal.config.ignore_actions` |
| Required               | no                                |
| Type                   | `list(String)`                    |
| Default value          | `[]`                              |

### Description

With this config option you can specify a list of actions that will be ignored by AppSignal. Everything that happens including exceptions will not be transmitted to AppSignal. This can be useful to ignore health check endpoints or other actions that you don't want to monitor.

Read more about [ignoring actions](/guides/filter-data/ignore-actions).

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.ignore_actions=$(encode "GET /health_check,POST /ping"),\
  ..."
```

## ignore\_errors

<a id="option-ignore_errors" />

| Field                  | Value                            |
| ---------------------- | -------------------------------- |
| Resource attribute key | `appsignal.config.ignore_errors` |
| Required               | no                               |
| Type                   | `list(String)`                   |
| Default value          | `[]`                             |

### Description

This config option allows you to ignore specific errors from being reported to AppSignal. This can be useful to ignore expected errors or errors that can't be solved.

Read more about [ignoring errors](/guides/filter-data/ignore-errors).

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.ignore_errors=$(encode "MyCustomError,ExpectedError"),\
  ..."
```

## ignore\_logs

<a id="option-ignore_logs" />

| Field                  | Value                          |
| ---------------------- | ------------------------------ |
| Resource attribute key | `appsignal.config.ignore_logs` |
| Required               | no                             |
| Type                   | `list(String)`                 |
| Default value          | `[]`                           |

### Description

List of log messages that will be ignored. Any log message containing any of the elements of the list will not be transmitted to AppSignal. A small subset of regex syntax is supported, read more about it in our [Ignore Logs](/guides/filter-data/ignore-logs) guide.

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.ignore_logs=$(encode "^done$,Task .* completed successfully"),\
  ..."
```

## ignore\_namespaces

<a id="option-ignore_namespaces" />

| Field                  | Value                                |
| ---------------------- | ------------------------------------ |
| Resource attribute key | `appsignal.config.ignore_namespaces` |
| Required               | no                                   |
| Type                   | `list(String)`                       |
| Default value          | `[]`                                 |

### Description

This config option allows you to ignore specific namespaces from being reported to AppSignal. This can be useful to ignore specific parts of your application from being monitored.

Read more about [namespaces](/application/namespaces).

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.ignore_namespaces=$(encode "admin,secret"),\
  ..."
```

## request\_headers

<a id="option-request_headers" />

| Field                  | Value                                                                                                                                  |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Resource attribute key | `appsignal.config.request_headers`                                                                                                     |
| Required               | no                                                                                                                                     |
| Type                   | `list(String)`                                                                                                                         |
| Default value          | `["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "host", "range"]` |

### Description

Configure which request headers to include when a request is made to an HTTP server. This option is an allowlist. It only includes the headers that are configured. If the list is empty, no headers are included.

The request headers are read from the `http.request.header.<key>` [OpenTelemetry span attributes](https://opentelemetry.io/docs/specs/semconv/http/http-spans/), where `<key>` is the normalized header name (lowercase).

To not set any headers, explicitly set the resource attribute value to an empty value.

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

# Only send these specific headers
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.request_headers=$(encode "accept,request_method,content_length"),\
  ..."

# Do not send any headers
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.request_headers=,\
  ..."
```

## response\_headers

<a id="option-response_headers" />

| Field                  | Value                                                                                                                                  |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Resource attribute key | `appsignal.config.response_headers`                                                                                                    |
| Required               | no                                                                                                                                     |
| Type                   | `list(String)`                                                                                                                         |
| Default value          | `["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "host", "range"]` |

### Description

Configure which response headers to include when a request is made by an HTTP client. This option is an allowlist. It only includes the headers that are configured. If the list is empty, no headers are included.

The response headers are read from the `http.response.header.<key>` [OpenTelemetry span attributes](https://opentelemetry.io/docs/specs/semconv/http/http-spans/), where `<key>` is the normalized header name (lowercase).

To not set any headers, explicitly set the resource attribute value to an empty array.

The expected format is a comma-separated list of values. The commas must be percent-encoded (replaced with `%2C`) in the environment variable. You can use the `encode` function provided in the snippet below to encode the list of values:

```bash Shell theme={null}
function encode() {
  echo -n "$@" | sed 's/,/%2C/g'
}

# Only send these specific headers
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.response_headers=$(encode "accept,request_method,content_length"),\
  ..."

# Do not send any headers
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.response_headers=,\
  ..."
```

## send\_function\_parameters

<a id="option-send_function_parameters" />

| Field                  | Value                                       |
| ---------------------- | ------------------------------------------- |
| Resource attribute key | `appsignal.config.send_function_parameters` |
| Required               | no                                          |
| Type                   | Boolean (`true` / `false`)                  |
| Default value          | `true`                                      |

### Description

Configure whether to include function parameters in traces. If set to `false` no such data is sent to our servers.

These values are set with the [`appsignal.function.parameters` span attribute](/guides/custom-data/function-parameters).

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.send_function_parameters=false,\
  ..."
```

## send\_request\_payload

<a id="option-send_request_payload" />

| Field                  | Value                                   |
| ---------------------- | --------------------------------------- |
| Resource attribute key | `appsignal.config.send_request_payload` |
| Required               | no                                      |
| Type                   | Boolean (`true` / `false`)              |
| Default value          | `true`                                  |

### Description

Configure whether to send request payload data in traces. If set to `false` no such data is sent to our servers.

These values are set with the [`appsignal.request.payload` span attribute](/guides/custom-data/request-parameters).

For more information please read about [request payload filtering](/application/parameter-filtering).

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.send_request_payload=false,\
  ..."
```

## send\_request\_query\_parameters

<a id="option-send_request_query_parameters" />

| Field                  | Value                                            |
| ---------------------- | ------------------------------------------------ |
| Resource attribute key | `appsignal.config.send_request_query_parameters` |
| Required               | no                                               |
| Type                   | Boolean (`true` / `false`)                       |
| Default value          | `true`                                           |

### Description

Configure whether to include request query parameters in traces. If set to `false` no such data is sent to our servers.

These values are set with the [`appsignal.request.query_parameters` span attribute](/guides/custom-data/request-parameters).

For more information please read about [request parameter filtering](/application/parameter-filtering).

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.send_request_query_parameters=false,\
  ..."
```

## send\_request\_session\_data

<a id="option-send_request_session_data" />

| Field                  | Value                                        |
| ---------------------- | -------------------------------------------- |
| Resource attribute key | `appsignal.config.send_request_session_data` |
| Required               | no                                           |
| Type                   | Boolean (`true` / `false`)                   |
| Default value          | `true`                                       |

### Description

Configure whether to send request session data in traces. If set to `false` no such data is sent to our servers.

These values are set with the [`appsignal.request.session_data` span attribute](/guides/custom-data/request-session-data).

For more information please read about [request session data filtering](/application/session-data-filtering).

```bash Shell theme={null}
export OTEL_RESOURCE_ATTRIBUTES="\
  appsignal.config.send_request_session_data=false,\
  ..."
```
