You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/edot-java/migration.md
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ products:
14
14
- id: apm-agent
15
15
---
16
16
17
-
# Migrate to EDOT Java from the Elastic APM Java agent
17
+
# Migrate to EDOT Java from the Elastic {{product.apm}} Java agent
18
18
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:
20
20
21
21
- Fully automatic instrumentation with zero code changes. No need to modify application code.
22
22
- 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
25
25
26
26
## Migration steps
27
27
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.
29
29
30
30
::::::{stepper}
31
31
32
32
::::{step} (Optional) Migrate manual instrumentation API
33
33
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:
35
35
36
36
- 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/).
37
37
- 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
47
47
48
48
::::{step} Replace the agent binary
49
49
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).
51
51
::::
52
52
53
53
::::::
54
54
55
55
## Configuration mapping
56
56
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.
58
64
59
65
### `server_url`
60
66
@@ -106,7 +112,7 @@ For example: `OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=testing`.
106
112
107
113
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).
108
114
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`
110
116
111
117
### `trace_methods`
112
118
@@ -140,16 +146,16 @@ Replace the Elastic `span_stack_trace_min_duration` option with [`OTEL_JAVA_EXPE
140
146
141
147
### `disable_instrumentations`
142
148
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.
144
150
145
151
See [OpenTelemetry documentation](https://opentelemetry.io/docs/zero-code/java/agent/disable/) for reference and values.
146
152
147
153
### `enable_instrumentations`
148
154
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:
150
156
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.
153
159
154
160
### `hostname`
155
161
@@ -167,25 +173,34 @@ For example: `OTEL_RESOURCE_ATTRIBUTES=service.instance.id=myserviceinstance001`
167
173
168
174
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.
169
175
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.
171
177
172
178
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).
173
179
174
180
### `log_sending`
175
181
176
182
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.
178
184
179
185
With EDOT, application logs are automatically captured and sent by default.
180
186
181
187
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`.
182
188
183
189
### `verify_server_cert`
184
190
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.
186
192
187
193
With EDOT, the equivalent configuration option is `ELASTIC_OTEL_VERIFY_SERVER_CERT` (default `true`), see [configuration](./configuration.md#exporter-certificate-verification) for details.
188
194
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.
0 commit comments