OpenTelemetry Java agent for Dynatrace: instrument an application and send its data
Your team wants standard, portable instrumentation for a Spring Boot application without changing its code. It has no OneAgent on these containers, or it has chosen OpenTelemetry as the platform standard. The OpenTelemetry Java agent for Dynatrace meets that need: one JAR file added at JVM startup, and traces, metrics and logs flow over OTLP to Dynatrace. Goal of this tutorial: download the…
The OpenTelemetry Java agent for Dynatrace allows instrumenting a Spring Boot application without modifying its code. It requires Java 8 or later and a Dynatrace API token with specific scopes. The OTLP endpoint URL varies depending on the Dynatrace setup (SaaS, Managed, or ActiveGate). To set up the agent, first download it and configure it with environment variables pointing to the Dynatrace endpoint and token.
Then start the JVM with the agent using the -javaagent option. In Kubernetes, copy the agent into a shared volume and load it with JAVA_TOOL_OPTIONS. After setup, verify the agent by checking start-up logs and exporting errors. For debugging, enable OTEL_JAVAAGENT_DEBUG=true. In Dynatrace SaaS, use a Notebook to fetch spans and confirm that the application's HTTP routes are visible.
On Managed, the service appears in the services list, and traces are visible in the distributed traces view, while metrics can be seen in the data explorer.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to