This documentation describes how to update applications using the Elastic APM Java agent to use the Elastic Distribution of OpenTelemetry Java (EDOT Java).
Start by installing EDOT Java following the steps outlined in Get started. Then update existing APM Java agent configuration options in your application with the equivalent OpenTelemetry SDK configuration variables (listed below).
This is a list of all APM Java agent configuration options grouped by their category. Select one of the following for more information.
- server_url
- server_urls
- secret_token
- api_key
- service_name
- enabled
- service_version
- environment
- global_labels
The Elastic server_url
option corresponds to the OpenTelemetry OTEL_EXPORTER_OTLP_ENDPOINT
option.
The Elastic server_urls
option has no equivalent OpenTelemetry option - you can only specify one endpoint. Use OTEL_EXPORTER_OTLP_ENDPOINT instead.
The Elastic secret_token
option corresponds to the OpenTelemetry OTEL_EXPORTER_OTLP_HEADERS option. For example: OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer an_apm_secret_token"
.
The Elastic api_key
option corresponds to the OpenTelemetry OTEL_EXPORTER_OTLP_HEADERS option. For example:OTEL_EXPORTER_OTLP_HEADERS="Authorization=ApiKey an_api_key"
.
The Elastic service_name
option corresponds to the OpenTelemetry OTEL_SERVICE_NAME option. The service name value can also be set using OTEL_RESOURCE_ATTRIBUTES. For example: OTEL_RESOURCE_ATTRIBUTES=service.name=myservice
. If OTEL_SERVICE_NAME
is set, it takes precedence over the resource attribute.
The Elastic enabled
option corresponds to the OpenTelemetry OTEL_JAVAAGENT_ENABLED option.
The Elastic service_version
option corresponds to setting the service.version
key in OTEL_RESOURCE_ATTRIBUTES. For example: OTEL_RESOURCE_ATTRIBUTES=service.version=1.2.3
.
The Elastic environment
option corresponds to setting the deployment.environment
key in OTEL_RESOURCE_ATTRIBUTES. For example: OTEL_RESOURCE_ATTRIBUTES=deployment.environment=testing
.
The Elastic global_labels
option corresponds to adding key=value
comma separated pairs in OTEL_RESOURCE_ATTRIBUTES. For example: OTEL_RESOURCE_ATTRIBUTES=alice=first,bob=second
. Such labels will result in labels.key=value attributes on the server, e.g. labels.alice=first