Kamon icon indicating copy to clipboard operation
Kamon copied to clipboard

Kamon-Jdbc doesn't support multiple hosts in connection url

Open yarosman opened this issue 4 years ago • 7 comments

~~When we try to use play-anorm with hikari-cp and proxy-sql we retrieve errors~~

Kamon-Jdbc doesn't support multiple hosts in connection url

java.lang.ClassCastException: class com.sun.proxy.$Proxy60 cannot be cast to class kamon.instrumentation.jdbc.HasDatabaseTags (com.sun.proxy.$Proxy60 and kamon.instrumentation.jdbc.HasDatabaseTags are in unnamed module of loader 'app')
	at kamon.instrumentation.jdbc.DriverConnectAdvice$.exit(StatementInstrumentation.scala:133)
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:220)
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473)
	at com.zaxxer.hikari.pool.HikariPool.access$100(HikariPool.java:71)
	at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:727)
	at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:713)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

yarosman avatar Jun 29 '21 11:06 yarosman

Can you give us the specific versions of libraries you are using?

SimunKaracic avatar Jul 05 '21 08:07 SimunKaracic

Can you give us the specific versions of libraries you are using?

  "io.kamon"                   %% "kamon-jdbc"                     % "2.1.3",
  "org.playframework.anorm"    %% "anorm"                          % "2.6.7",
  "mysql"                      % "mysql-connector-java"            % "8.0.20",

yarosman avatar Jul 06 '21 07:07 yarosman

@SimunKaracic we thought that we found the main reason for these problem. If you use several IPs in connection url, instrumentation willn't work for FAILOVER_CONNECTION

mysql-connection

yarosman avatar Jul 20 '21 15:07 yarosman

Nice debugging. Not sure how fast we'll fix this, but atleast we know where the problem is!

SimunKaracic avatar Jul 21 '21 11:07 SimunKaracic

any news ?

yarosman avatar Nov 14 '23 12:11 yarosman