diff --git a/instrumentation/kamon-jdbc/src/main/scala/kamon/instrumentation/jdbc/StatementInstrumentation.scala b/instrumentation/kamon-jdbc/src/main/scala/kamon/instrumentation/jdbc/StatementInstrumentation.scala index 3acb540d6..a82bb2f19 100644 --- a/instrumentation/kamon-jdbc/src/main/scala/kamon/instrumentation/jdbc/StatementInstrumentation.scala +++ b/instrumentation/kamon-jdbc/src/main/scala/kamon/instrumentation/jdbc/StatementInstrumentation.scala @@ -90,7 +90,7 @@ class StatementInstrumentation extends InstrumentationBuilder { * information in that Statement to have the proper pool information and ensure that the check round trips will be * observed appropriately. */ - onType("org.postgresql.jdbc.PgConnection") + onTypesMatching(named("org.postgresql.jdbc.PgConnection").and(declaresField(named("checkConnectionQuery")))) .bridge(classOf[PgConnectionIsAliveAdvice.PgConnectionPrivateAccess]) .advise(method("isValid"), PgConnectionIsAliveAdvice)