Skip to content

Commit bdc5d21

Browse files
docs: improve EDOT Java migration guide for accuracy & structure (#962)
* Update migration documentation for EDOT Java to reflect changes in Elastic APM references and clarify configuration mappings
1 parent 272d8e1 commit bdc5d21

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

docs/reference/edot-java/migration.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ products:
1414
- id: apm-agent
1515
---
1616

17-
# Migrate to EDOT Java from the Elastic APM Java agent
17+
# Migrate to EDOT Java from the Elastic {{product.apm}} Java agent
1818

19-
Compared to the Elastic APM Java agent, the {{edot}} Java presents a number of advantages:
19+
Compared to the Elastic {{product.apm}} Java agent, the {{edot}} Java presents a number of advantages:
2020

2121
- Fully automatic instrumentation with zero code changes. No need to modify application code.
2222
- Capture, send, transform, and store data in an OpenTelemetry native way. This includes for example the ability to use all features of the OpenTelemetry SDK for manual tracing, data following semantic conventions, or ability to use intermediate collectors and processors.
@@ -25,13 +25,13 @@ Compared to the Elastic APM Java agent, the {{edot}} Java presents a number of a
2525

2626
## Migration steps
2727

28-
Follow these steps to migrate from the legacy Elastic APM Java agent to the {{edot}} Java.
28+
Follow these steps to migrate from the legacy Elastic {{product.apm}} Java agent to the {{edot}} Java.
2929

3030
::::::{stepper}
3131

3232
::::{step} (Optional) Migrate manual instrumentation API
3333

34-
Migrate usages of the [Elastic APM Agent API](apm-agent-java://reference/public-api.md) to OpenTelemetry API:
34+
Migrate usages of the [Elastic {{product.apm-agent}} API](apm-agent-java://reference/public-api.md) to OpenTelemetry API:
3535

3636
- For [Annotation API](apm-agent-java://reference/public-api.md#api-annotation), refer to [OpenTelemetry Annotations](https://opentelemetry.io/docs/zero-code/java/agent/annotations/).
3737
- For [Transaction API](apm-agent-java://reference/public-api.md#api-transaction), refer to [OpenTelemetry API](https://opentelemetry.io/docs/zero-code/java/agent/api/).
@@ -47,14 +47,20 @@ Refer to the [Configuration mapping](#configuration-mapping). Refer to [Configur
4747

4848
::::{step} Replace the agent binary
4949

50-
Remove the `-javaagent:` argument that contains the Elastic APM Java agent from the JVM arguments. Then add the `-javaagent:` argument to the JVM arguments to use EDOT Java, and restart the application or follow [Kubernetes instructions](/reference/edot-java/setup/k8s.md) or [Runtime attach instructions](/reference/edot-java/setup/runtime-attach.md) if applicable. Refer to [Setup](/reference/edot-java/setup/index.md).
50+
Remove the `-javaagent:` argument that contains the Elastic {{product.apm}} Java agent from the JVM arguments. Then add the `-javaagent:` argument to the JVM arguments to use EDOT Java, and restart the application or follow [Kubernetes instructions](/reference/edot-java/setup/k8s.md) or [Runtime attach instructions](/reference/edot-java/setup/runtime-attach.md) if applicable. Refer to [Setup](/reference/edot-java/setup/index.md).
5151
::::
5252

5353
::::::
5454

5555
## Configuration mapping
5656

57-
The following are Elastic APM Java agent settings that you can migrate to EDOT Java.
57+
The following describes how Elastic {{product.apm}} Java agent configuration maps to EDOT Java. It includes how resource attributes are handled when using the EDOT Collector, followed by each agent setting and its EDOT equivalent.
58+
59+
### Resource attributes when using the EDOT Collector
60+
61+
Ingesting OpenTelemetry data directly through {{product.apm-server}} is [no longer supported](opentelemetry://reference/architecture/index.md#limitations). Historically, when ingesting OpenTelemetry data through the Elastic {{product.apm-server}}, unmapped resource attributes were added under `labels.*`. This behavior does not apply when using the EDOT Collector and is not recommended for new deployments. Use the EDOT Collector or Managed OTLP for supported ingestion.
62+
63+
If you rely on specific attribute mappings for querying or filtering in {{product.observability}}, configure explicit attribute processors in the EDOT Collector pipeline.
5864

5965
### `server_url`
6066

@@ -106,7 +112,7 @@ For example: `OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=testing`.
106112

107113
The Elastic [`global_labels`](apm-agent-java://reference/config-core.md#config-global-labels) option corresponds to adding `key=value` comma separated pairs in [OTEL_RESOURCE_ATTRIBUTES](https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_resource_attributes).
108114

109-
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
115+
For example: `OTEL_RESOURCE_ATTRIBUTES=alice=first,bob=second`
110116

111117
### `trace_methods`
112118

@@ -140,16 +146,16 @@ Replace the Elastic `span_stack_trace_min_duration` option with [`OTEL_JAVA_EXPE
140146

141147
### `disable_instrumentations`
142148

143-
Replace the `disable_instrumentations` option, which allows to selectively disable instrumentation (opt-out), with `OTEL_INSTRUMENTATION_<name>_ENABLED` where `<name>` is the instrumentation name.
149+
Replace the `disable_instrumentations` option, which allows to selectively turn off instrumentation (opt-out), with `OTEL_INSTRUMENTATION_<name>_ENABLED` where `<name>` is the instrumentation name.
144150

145151
See [OpenTelemetry documentation](https://opentelemetry.io/docs/zero-code/java/agent/disable/) for reference and values.
146152

147153
### `enable_instrumentations`
148154

149-
The `enable_instrumentations` option allows to disable all instrumentation enabled by default and selectively enable instrumentation (opt-in) can be replaced with:
155+
The `enable_instrumentations` option allows to turn off all instrumentation enabled by default and selectively enable instrumentation (opt-in) can be replaced with:
150156

151-
- `OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED` = `false` to disable instrumentations enabled by default.
152-
- `OTEL_INSTRUMENTATION_<name>_ENABLED` = `true` where `<name>` is the name of the instrumentation to enable. See [OpenTelemetry documentation](https://opentelemetry.io/docs/zero-code/java/agent/disable/) for reference and values.
157+
- `OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED` = `false` to turn off instrumentations enabled by default.
158+
- `OTEL_INSTRUMENTATION_<name>_ENABLED` = `true` where `<name>` is the name of the instrumentation to enable. Refer to [OpenTelemetry documentation](https://opentelemetry.io/docs/zero-code/java/agent/disable/) for reference and values.
153159

154160
### `hostname`
155161

@@ -167,25 +173,34 @@ For example: `OTEL_RESOURCE_ATTRIBUTES=service.instance.id=myserviceinstance001`
167173

168174
The Elastic [`cloud_provider`](apm-agent-java://reference/config-core.md#config-cloud-provider) option corresponds to the per-provider `otel.resource.providers.{provider}.enabled` configuration options.
169175

170-
By default, with EDOT `otel.resource.providers.{provider}.enabled` is set to `true`, this is equivalent to the `cloud_provider` default valuem which is `auto`, or automatically detect cloud providers. Notice that this behavior differs from the contrib OpenTelemetry distribution.
176+
By default, with EDOT `otel.resource.providers.{provider}.enabled` is set to `true`, this is equivalent to the `cloud_provider` default value which is `auto`, or automatically detect cloud providers. Notice that this behavior differs from the contrib OpenTelemetry distribution.
171177

172178
When the cloud provider is known, or there is none, turning off the non-relevant providers with `otel.resource.providers.{provider}.enabled = false` allows to [minimize the application startup overhead](/reference/edot-java/overhead.md#optimizing-application-startup).
173179

174180
### `log_sending`
175181

176182
The Elastic [`log_sending`](apm-agent-java://reference/config-logging.md#config-log-sending) option allows capturing and
177-
sending application logs directly to APM Server without storing them on disk and ingesting them with a separate tool.
183+
sending application logs directly to {{product.apm-server}} without storing them on disk and ingesting them with a separate tool.
178184

179185
With EDOT, application logs are automatically captured and sent by default.
180186

181187
This feature is controlled by `otel.logs.exporter`, which is set to `otlp` by default. You can turn it off by setting `otel.logs.exporter` to `none`.
182188

183189
### `verify_server_cert`
184190

185-
The Elastic [`verify_server_cert`](apm-agent-java://reference/config-reporter.md#config-verify-server-cert) option allows you to disable server certificate validation.
191+
The Elastic [`verify_server_cert`](apm-agent-java://reference/config-reporter.md#config-verify-server-cert) option allows you to turn off server certificate validation.
186192

187193
With EDOT, the equivalent configuration option is `ELASTIC_OTEL_VERIFY_SERVER_CERT` (default `true`), see [configuration](./configuration.md#exporter-certificate-verification) for details.
188194

195+
### No equivalent for `application_packages`
196+
197+
The Elastic {{product.apm}} Java agent provided an `application_packages` setting with multiple purposes, including startup optimization and stack trace filtering. EDOT Java doesn't provide an equivalent configuration for the following reasons:
198+
199+
- EDOT Java does not support package-based scoping to reduce instrumentation overhead at startup. To reduce startup overhead, turn off unneeded instrumentations instead.
200+
- Package-based stack trace filtering (as provided by `application_packages`) is not currently supported in {{kib}} for EDOT data because EDOT stack traces are captured as flat strings rather than structured frames.
201+
202+
The `OTEL_JAVA_EXPERIMENTAL_SPAN_STACKTRACE_MIN_DURATION` setting controls when stack traces are captured, but it does not provide package-based filtering.
203+
189204
## Limitations
190205

191206
The following limitations apply to EDOT Java.

0 commit comments

Comments
 (0)