Configurationedit
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:
2) Properties file |
The |
3) Java system properties |
|
4) Environment variables |
All configuration keys are in uppercase and prefixed with |
5) Runtime attach parameters |
|
6) Default values |
Defined for each configuration. |
Dynamic configuration
edit
Configuration options marked with Dynamic true can be changed at runtime when set from supported sources:
- Central configuration
-
elasticapm.properties
file - Java system properties, but only 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.
-
Circuit-Breaker configuration options
-
circuit_breaker_enabled
( [1.14.0] Added in 1.14.0. performance experimental) -
stress_monitoring_interval
(performance) -
stress_monitor_gc_stress_threshold
(performance) -
stress_monitor_gc_relief_threshold
(performance) -
stress_monitor_cpu_duration_threshold
(performance) -
stress_monitor_system_cpu_stress_threshold
(performance) -
stress_monitor_system_cpu_relief_threshold
(performance)
-
-
-
recording
( [1.15.0] Added in 1.15.0. ) -
enabled
( [1.18.0] Added in 1.18.0. ) -
instrument
( [1.0.0] Added in 1.0.0. Changing this value at runtime is possible since version 1.15.0 ) -
service_name
-
service_node_name
( [1.11.0] Added in 1.11.0. ) -
service_version
-
hostname
( [1.10.0] Added in 1.10.0. ) -
environment
-
transaction_sample_rate
(performance) -
transaction_max_spans
(performance) -
sanitize_field_names
(security) -
disable_instrumentations
( [1.0.0] Added in 1.0.0. Changing this value at runtime is possible since version 1.15.0 ) -
unnest_exceptions
-
ignore_exceptions
( [1.11.0] Added in 1.11.0. ) -
capture_body
(performance) -
capture_headers
(performance) -
global_labels
( [1.7.0] Added in 1.7.0. Requires APM Server 7.2+ ) -
classes_excluded_from_instrumentation
-
trace_methods
( [1.0.0] Added in 1.0.0. Changing this value at runtime is possible since version 1.15.0 ) -
trace_methods_duration_threshold
( [1.7.0] Added in 1.7.0. ) -
central_config
( [1.8.0] Added in 1.8.0. ) -
breakdown_metrics
( [1.8.0] Added in 1.8.0. ) -
config_file
( [1.8.0] Added in 1.8.0. ) -
use_elastic_traceparent_header
( [1.14.0] Added in 1.14.0. ) -
span_min_duration
( [1.16.0] Added in 1.16.0. )
-
-
Profiling configuration options
-
profiling_inferred_spans_enabled
( [1.15.0] Added in 1.15.0. experimental) -
profiling_inferred_spans_sampling_interval
( [1.15.0] Added in 1.15.0. ) -
profiling_inferred_spans_min_duration
( [1.15.0] Added in 1.15.0. ) -
profiling_inferred_spans_included_classes
( [1.15.0] Added in 1.15.0. ) -
profiling_inferred_spans_excluded_classes
( [1.15.0] Added in 1.15.0. ) -
profiling_inferred_spans_lib_directory
( [1.18.0] Added in 1.18.0. )
-