This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/executors.md.

Java Executors

OpenTelemetry Java agent instrumentation

The executor instrumentation ensures that context is automatically propagated when using common Java executors (e.g., ThreadPoolExecutor, ScheduledThreadPoolExecutor, ForkJoinPool). When a task is submitted, the current context is captured and bound to the task. Then, when the task eventually runs, even if it’s on a different thread, the instrumentation reactivates that context, enabling consistent correlation across concurrent and asynchronous workflows.

  • Name: executors
  • Scope: io.opentelemetry.executors
  • Target versions: Java 8+
  • Library: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html

Configuration

OptionTypeDefaultDescription
otel.instrumentation.executors.includelistList of Executor subclasses to be instrumented.
otel.instrumentation.executors.include-allbooleanfalseWhether to instrument all classes that implement the Executor interface.

Data

  • JSON: /data/javaagent/instrumentations/executors/executors-c20b3e5eb5c8.json
  • Explore: /java-agent/instrumentation/executors