Skip to content

Commit

Permalink
Fix instrumentation for vert.x 4.3.4 (open-telemetry#6809)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored and LironKS committed Dec 4, 2022
1 parent ac859c4 commit fbb9526
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public void transform(TypeTransformer transformer) {
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")
Expand All @@ -51,4 +55,13 @@ public static void wrapHandler(
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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,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.+")
}

0 comments on commit fbb9526

Please sign in to comment.