To adapt the Elastic APM Java agent to your needs, you can configure it using one of the methods below, listed in descending order of precedence:

1) Central configuration

Configure the Agent in the Kibana APM app. dynamic config

2) Properties file

The file is located in the same folder as the agent jar, or provided through the config_file option. dynamic config

3) Java system properties

All configuration keys are prefixed with elastic.apm.
dynamic config

4) Environment variables

All configuration keys are in uppercase and prefixed with ELASTIC_APM_.

5) Runtime attach parameters

  1. --config parameter.
    See Automatic setup with apm-agent-attach-cli.jar.
  2. Arguments of ElasticApmAttacher.attach(...).
    See Programmatic API setup to self-attach.
  3. in classpath root with ElasticApmAttacher.attach().
    See Programmatic API setup to self-attach.

6) Default values

Defined for each configuration.

Dynamic configuration dynamic configedit

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

  • Central configuration
  • file
  • Java system properties, but only when set from within the application

There are two distinct ways to use 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_url and application_packages. Note that even these settings are optional. Click on their name to see how the default values are determined.

An example configuration looks like this:

System properties.



Environment variables.


Option referenceedit

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