Configuration
editConfiguration
editTo 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
editConfiguration 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 configuration
editIn 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.
-Delastic.apm.service_name=my-cool-service -Delastic.apm.application_packages=org.example,org.another.example -Delastic.apm.server_url=http://127.0.0.1:8200
elasticapm.properties.
service_name=my-cool-service application_packages=org.example,org.another.example server_url=http://127.0.0.1:8200
Environment variables.
ELASTIC_APM_SERVICE_NAME=my-cool-service ELASTIC_APM_APPLICATION_PACKAGES=org.example,org.another.example ELASTIC_APM_SERVER_url=http://127.0.0.1:8200
Option reference
editThis is a list of all configuration options grouped by their category. Click on a key to get more information.
-
-
circuit_breaker_enabled
( [1.14.0] Added in 1.14.0. performance) -
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) -
long_field_max_length
(performance [1.37.0] Added in 1.37.0. ) -
sanitize_field_names
(security) -
enable_instrumentations
( [1.28.0] Added in 1.28.0. ) -
disable_instrumentations
( [1.0.0] Added in 1.0.0. Changing this value at runtime is possible since version 1.15.0 ) -
enable_experimental_instrumentations
( [1.25.0] Added in 1.25.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+ ) -
instrument_ancient_bytecode
( [1.35.0] Added in 1.35.0. ) -
context_propagation_only
( [1.44.0] Added in 1.44.0. ) -
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. ) -
plugins_dir
(experimental) -
use_elastic_traceparent_header
( [1.14.0] Added in 1.14.0. ) -
disable_outgoing_tracecontext_headers
( [1.37.0] Added in 1.37.0. ) -
span_min_duration
( [1.16.0] Added in 1.16.0. ) -
cloud_provider
( [1.21.0] Added in 1.21.0. ) -
enable_public_api_annotation_inheritance
(performance) -
transaction_name_groups
( [1.33.0] Added in 1.33.0. ) -
trace_continuation_strategy
( [1.34.0] Added in 1.34.0. ) -
baggage_to_attach
( [1.43.0] Added in 1.43.0. )
-
-
-
capture_body_content_types
( [1.5.0] Added in 1.5.0. performance) -
transaction_ignore_urls
-
transaction_ignore_user_agents
( [1.22.0] Added in 1.22.0. ) -
use_path_as_transaction_name
( [1.0.0] Added in 1.0.0. Changing this value at runtime is possible since version 1.22.0 ) -
url_groups
(deprecated) -
capture_http_client_request_body_size
( [1.52.0] Added in 1.52.0. experimental)
-
-
-
log_level
-
log_file
-
log_ecs_reformatting
( [1.22.0] Added in 1.22.0. experimental) -
log_ecs_reformatting_additional_fields
( [1.26.0] Added in 1.26.0. ) -
log_ecs_formatter_allow_list
-
log_ecs_reformatting_dir
-
log_file_size
( [1.17.0] Added in 1.17.0. ) -
log_format_sout
( [1.17.0] Added in 1.17.0. ) -
log_format_file
( [1.17.0] Added in 1.17.0. ) -
log_sending
( [1.36.0] Added in 1.36.0. experimental)
-
-
-
universal_profiling_integration_enabled
( [1.50.0] Added in 1.50.0. ) -
universal_profiling_integration_buffer_size
( [1.50.0] Added in 1.50.0. ) -
universal_profiling_integration_socket_dir
( [1.50.0] Added in 1.50.0. ) -
profiling_inferred_spans_enabled
( [1.15.0] Added in 1.15.0. experimental) -
profiling_inferred_spans_logging_enabled
( [1.37.0] Added in 1.37.0. ) -
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. )
-