Skip to content

Add instrumentation for vert.x TaskQueue#18709

Merged
trask merged 5 commits into
open-telemetry:mainfrom
laurit:vertx-task-queue
May 16, 2026
Merged

Add instrumentation for vert.x TaskQueue#18709
trask merged 5 commits into
open-telemetry:mainfrom
laurit:vertx-task-queue

Conversation

@laurit

@laurit laurit commented May 12, 2026

Copy link
Copy Markdown
Contributor

Hopefully fixes flakiness of VertxReactivePropagationTest.highConcurrency

Copilot AI review requested due to automatic review settings May 12, 2026 14:09
@laurit laurit requested a review from a team as a code owner May 12, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Javaagent instrumentation to propagate OpenTelemetry Context through Vert.x internal io.vertx.core.impl.TaskQueue, aiming to stabilize high-concurrency context propagation (notably VertxReactivePropagationTest.highConcurrency).

Changes:

  • Introduces TaskQueueInstrumentation to wrap/propagate context for tasks submitted via TaskQueue.execute(Runnable).
  • Adds executors bootstrap dependency to support context-propagating runnable helpers.
  • Registers the new type instrumentation in Vert.x HTTP client javaagent modules for 3.0, 4.0, and 5.0.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
instrumentation/vertx/vertx-http-client/vertx-http-client-common-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/httpclient/common/v3_0/TaskQueueInstrumentation.java New ByteBuddy advice to propagate context on TaskQueue.execute(Runnable) and clear thread context during internal queue consumption setup.
instrumentation/vertx/vertx-http-client/vertx-http-client-common-3.0/javaagent/build.gradle.kts Adds executors bootstrap dependency needed by the new instrumentation.
instrumentation/vertx/vertx-http-client/vertx-http-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/httpclient/v5_0/VertxClientInstrumentationModule.java Registers TaskQueueInstrumentation for Vert.x 5 HTTP client instrumentation.
instrumentation/vertx/vertx-http-client/vertx-http-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/httpclient/v4_0/VertxClientInstrumentationModule.java Registers TaskQueueInstrumentation for Vert.x 4 HTTP client instrumentation.
instrumentation/vertx/vertx-http-client/vertx-http-client-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/httpclient/v3_0/VertxClientInstrumentationModule.java Registers TaskQueueInstrumentation for Vert.x 3 HTTP client instrumentation.

Comment on lines +41 to +50
public static Object[] onEnter(@Advice.Argument(0) Runnable task) {
// Attach context to the task being executed and prevent further context propagation in this
// method. This method places the task into queue and executes a runnable that start consuming
// tasks from the queue. Since we already attached context to the task, we don't want to
// propagate context into the runnable that consumes tasks from the queue.
Context context = Java8BytecodeBridge.currentContext();
return new Object[] {
ContextPropagatingRunnable.propagateContext(task, context),
Java8BytecodeBridge.rootContext().makeCurrent()
};
laurit and others added 3 commits May 12, 2026 18:50
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@laurit laurit added this to the v2.28.0 milestone May 13, 2026
@trask trask merged commit d876106 into open-telemetry:main May 16, 2026
95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants