Core configuration optionsedit

activeedit

A boolean specifying if the agent should be active or not. If active, the agent will instrument incoming HTTP requests and track errors.

You can use this setting to dynamically disable Elastic APM at runtime.

Default Type Dynamic

true

Boolean

true

Java System Properties Environment

elastic.apm.active

ELASTIC_APM_ACTIVE

instrumentedit

A boolean specifying if the agent should instrument the application to collect performance metrics for the app. When set to false, Elastic APM will not affect your application at all.

Note

Both active and instrument needs to be true for instrumentation to be running.

Default Type Dynamic

true

Boolean

false

Java System Properties Environment

elastic.apm.instrument

ELASTIC_APM_INSTRUMENT

service_nameedit

This is used to keep all the errors and transactions of your service together and is the primary filter in the Elastic APM user interface.

Note

The service name must conform to this regular expression: ^[a-zA-Z0-9 _-]+$. In less regexy terms: Your service name must only contain characters from the ASCII alphabet, numbers, dashes, underscores and spaces.

Default Type Dynamic

<none>

String

false

Java System Properties Environment

elastic.apm.service_name

ELASTIC_APM_SERVICE_NAME

service_versionedit

A version string for the currently deployed version of the service. If you don’t version your deployments, the recommended value for this field is the commit identifier of the deployed revision, e.g. the output of git rev-parse HEAD.

Default Type Dynamic

<none>

String

false

Java System Properties Environment

elastic.apm.service_version

ELASTIC_APM_SERVICE_VERSION

environmentedit

The name of the environment this service is deployed in, e.g. "production" or "staging".

Default Type Dynamic

<none>

String

false

Java System Properties Environment

elastic.apm.environment

ELASTIC_APM_ENVIRONMENT

sample_rateedit

By default, the agent will sample every transaction (e.g. request to your service). To reduce overhead and storage requirements, you can set the sample rate to a value between 0.0 and 1.0. We still record overall time and the result for unsampled transactions, but no context information, tags, or spans.

Default Type Dynamic

1.0

Double

true

Java System Properties Environment

elastic.apm.sample_rate

ELASTIC_APM_SAMPLE_RATE

transaction_max_spansedit

Limits the amount of spans that are recorded per transaction.

This is helpful in cases where a transaction creates a very high amount of spans (e.g. thousands of SQL queries).

Setting an upper limit will prevent overloading the agent and the APM server with too much work for such edge cases.

Default Type Dynamic

500

Integer

true

Java System Properties Environment

elastic.apm.transaction_max_spans

ELASTIC_APM_TRANSACTION_MAX_SPANS

sanitize_field_namesedit

Sometimes it is necessary to sanitize the data sent to Elastic APM, e.g. remove sensitive data.

Configure a list of wildcard patterns of field names which should be sanitized. These apply for example to HTTP headers and application/x-www-form-urlencoded data.

Entries can have a wildcard at the beginning and at the end. Prepending an element with (?i) makes the matching case-insensitive.

Note

Data in the query string is considered non-sensitive, as sensitive information should not be sent in the query string. See https://www.owasp.org/index.php/Information_exposure_through_query_strings_in_url for more information

Note

Review the data captured by Elastic APM carefully to make sure it does not capture sensitive information. If you do find sensitive data in the Elasticsearch index, you should add an additional entry to this list (make sure to also include the default entries).

Default Type Dynamic

(?i)password, (?i)passwd, (?i)pwd, (?i)secret, (?i)token, (?i)*key, (?i)*token, (?i)*session*, (?i)*credit*, (?i)*card*, (?i)authorization, (?i)set-cookie

List

true

Java System Properties Environment

elastic.apm.sanitize_field_names

ELASTIC_APM_SANITIZE_FIELD_NAMES

disabled_instrumentationsedit

A list of instrumentations which should be disabled. Valid options are jdbc, servlet-api and spring-mvc.

Default Type Dynamic

<none>

Collection

false

Java System Properties Environment

elastic.apm.disabled_instrumentations

ELASTIC_APM_DISABLED_INSTRUMENTATIONS