Core configuration options

edit

active

edit

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 Property file Environment

elastic.apm.active

active

ELASTIC_APM_ACTIVE

instrument

edit

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.

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

Default Type Dynamic

true

Boolean

false

Java System Properties Property file Environment

elastic.apm.instrument

instrument

ELASTIC_APM_INSTRUMENT

service_name

edit

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.

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

Name of main class or jar

String

false

Java System Properties Property file Environment

elastic.apm.service_name

service_name

ELASTIC_APM_SERVICE_NAME

service_version

edit

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 Property file Environment

elastic.apm.service_version

service_version

ELASTIC_APM_SERVICE_VERSION

environment

edit

The name of the environment this service is deployed in, e.g. "production" or "staging".NOTE: The APM UI does not fully support the environment setting yet. You can use the query bar to filter for a specific environment, but by default the environments will be mixed together. Also keep that in mind when creating alerts.

Default Type Dynamic

<none>

String

false

Java System Properties Property file Environment

elastic.apm.environment

environment

ELASTIC_APM_ENVIRONMENT

transaction_sample_rate

edit

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 Property file Environment

elastic.apm.transaction_sample_rate

transaction_sample_rate

ELASTIC_APM_TRANSACTION_SAMPLE_RATE

transaction_max_spans

edit

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 Property file Environment

elastic.apm.transaction_max_spans

transaction_max_spans

ELASTIC_APM_TRANSACTION_MAX_SPANS

sanitize_field_names

edit

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.

A wildcard expression may either contain a single wildcard in the middle or have wildcards at the beginning and/or the end. Legal: *foo*, foo*, *foo, foo*bar*. Illegal: foo*bar*, foo*bar*baz. Prepending an element with (?i) makes the matching case-insensitive.

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

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 Property file Environment

elastic.apm.sanitize_field_names

sanitize_field_names

ELASTIC_APM_SANITIZE_FIELD_NAMES

disable_instrumentations

edit

A list of instrumentations which should be disabled. Valid options are jdbc, servlet-api, servlet-api-async, spring-mvc, http-client, apache-httpclient,spring-resttemplate and incubating. If you want to try out incubating features, set the value to an empty string.

Default Type Dynamic

incubating

Collection

false

Java System Properties Property file Environment

elastic.apm.disable_instrumentations

disable_instrumentations

ELASTIC_APM_DISABLE_INSTRUMENTATIONS