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
| Option | Type | Default | Description |
|---|---|---|---|
otel.instrumentation.executors.include | list | List of Executor subclasses to be instrumented. | |
otel.instrumentation.executors.include-all | boolean | false | Whether to instrument all classes that implement the Executor interface. |