Configurationedit

The Elastic APM agent can be configured through different configuration sources, with the following descending order of precedence:

No prefix is required for the configuration keys unless stated otherwise.

  1. Central configuration
    Supports Dynamic configuration
  2. elasticapm.properties file
    In same folder as agent jar or provided through config_file ( [1.8.0] Added in 1.8.0. ) option.
    Supports Dynamic configuration
  3. Java system properties
    All configuration keys are prefixed with elastic.apm.
    Supports Dynamic configuration when set from the application.
  4. Environment variables
    All configuration keys are in uppercase and prefixed with ELASTIC_APM_
  5. runtime attach parameters, those are mutually exclusive

    1. --config parameter (Automatic setup with apm-agent-attach-standalone.jar)
    2. arguments of ElasticApmAttacher.attach(...) (Programmatic API setup to self-attach)
    3. elasticapm.properties in classpath root with ElasticApmAttacher.attach() (Programmatic API setup to self-attach)
  6. default values

Dynamic configurationedit

Configuration options marked with Dynamic true can be changed at runtime when set from sources that support it:

  • Central configuration
  • elasticapm.properties file
  • Java system properties when set from within the application.

There are two distinct ways to use elasticapm.properties: as an external configuration file, and as a classpath resource
Only the external file can be used for dynamic configuration.

Minimal configurationedit

In order to get started with Elastic APM, the most important configuration options are service_name, server_urls and application_packages. So a minimal version of a configuration might look like this:

System properties.

-Delastic.apm.service_name=my-cool-service
-Delastic.apm.application_packages=org.example,org.another.example
-Delastic.apm.server_urls=http://localhost:8200

elasticapm.properties.

service_name=my-cool-service
application_packages=org.example,org.another.example
server_urls=http://localhost:8200

Environment variables.

ELASTIC_APM_SERVICE_NAME=my-cool-service
ELASTIC_APM_APPLICATION_PACKAGES=org.example,org.another.example
ELASTIC_APM_SERVER_URLS=http://localhost:8200

Option referenceedit

This is a list of all configuration options grouped by their category. Click on a key to get more information.