Fix instrumentation for vert.x 4.3.4
Resolves
MODIFY
instrumentation/vertx/vertx-http-client/vertx-http-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/client/ConnectionManagerInstrumentation.java
instrumentation/vertx/vertx-http-client/vertx-http-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/client/ConnectionManagerInstrumentation.java
@@ -32,6 +32,10 @@ public class ConnectionManagerInstrumentation implements TypeInstrumentation {
transformer.applyAdviceToMethod(
named("getConnection").and(takesArgument(3, named("io.vertx.core.Handler"))),
ConnectionManagerInstrumentation.class.getName() + "$GetConnectionArg3Advice");
+ // since 4.3.4
+ transformer.applyAdviceToMethod(
+ named("getConnection").and(takesArgument(4, named("io.vertx.core.Handler"))),
+ ConnectionManagerInstrumentation.class.getName() + "$GetConnectionArg4Advice");
}
@SuppressWarnings("unused")
@@ -51,4 +55,13 @@ public class ConnectionManagerInstrumentation implements TypeInstrumentation {
handler = HandlerWrapper.wrap(handler);
}
}
+
+ @SuppressWarnings("unused")
+ public static class GetConnectionArg4Advice {
+ @Advice.OnMethodEnter(suppress = Throwable.class)
+ public static void wrapHandler(
+ @Advice.Argument(value = 4, readOnly = false) Handler<?> handler) {
+ handler = HandlerWrapper.wrap(handler);
+ }
+ }
}

MODIFY
instrumentation/vertx/vertx-rx-java-3.5/javaagent/build.gradle.kts
instrumentation/vertx/vertx-rx-java-3.5/javaagent/build.gradle.kts
@@ -46,11 +46,9 @@ dependencies {
add("version35TestImplementation", "io.vertx:vertx-jdbc-client:$vertxVersion")
add("version35TestImplementation", "io.vertx:vertx-circuit-breaker:$vertxVersion")
- // concurrency tests are failing with 4.3.4
- // tracking at https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/6790
- add("latestDepTestImplementation", "io.vertx:vertx-web:4.3.3")
- add("latestDepTestImplementation", "io.vertx:vertx-rx-java2:4.3.3")
- add("latestDepTestImplementation", "io.vertx:vertx-web-client:4.3.3")
- add("latestDepTestImplementation", "io.vertx:vertx-jdbc-client:4.3.3")
- add("latestDepTestImplementation", "io.vertx:vertx-circuit-breaker:4.3.3")
+ add("latestDepTestImplementation", "io.vertx:vertx-web:4.+")
+ add("latestDepTestImplementation", "io.vertx:vertx-rx-java2:4.+")
+ add("latestDepTestImplementation", "io.vertx:vertx-web-client:4.+")
+ add("latestDepTestImplementation", "io.vertx:vertx-jdbc-client:4.+")
+ add("latestDepTestImplementation", "io.vertx:vertx-circuit-breaker:4.+")
}

Fix instrumentation for vert.x 4.3.4 (#6809)

Resolves
https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/6790