Automatic Instrumentation in the IDE

The easiest way to get started with Digma is to use the Digma plugin to automatically instrument your application when you run it in the IDE.

To get started, make sure that that Observability toggle is set to on. You can always use this control to turn auto-instrumentation on and off.

By default, when you enable the observability toggle, Digma will download and add the OTEL Java Agent and dynamically add it to your runtime configuration when you launch your application in the IDE. In addition, the Digma Agent extension is also downloaded and referenced to add additional instrumentation data.

How to tell if your code is automatically instrumented with the Java Agent

Running your application in the IDE you should expect to see the following messages in the console output:

If everything works well, after triggering several actions on your applications you should see the observability panel update to show the recent activity:

How do I know if my Java stack is supported?

The Java OTEL Agent supported libraries page maintains an exhaustive list of frameworks and libraries currently automatically instrumented by the Java OTEL agent. For any of these frameworks, without any code changes, Digma will automatically receive and process tracing data that includes endpoint information, database queries, consumer data, and more.

What if your Run Configuration is not automatically instrumented

With the observability toggle enabled, auto-instrumentation will automatically be added to the following run configurations:

  1. Java applications configuration type

  2. Spring applications using the Spring plugin

  3. Specific common Maven / Gradle tasks for running application

  4. Other plugins (Tomcat, others)

However, Digma will purposely not instrument *every* Run Configuration, as it can be harmful to add the agent instrumentation to utility or build tasks. If Digma is not automatically adding instrumentation to your custom Gradle or Maven task, you can add the DIGMA_OBSERVABILITY=true environment variable. This will ensure the Digma Plugin will instrument the run configuration configuration.

Last updated