dd-trace-java
dd-trace-java copied to clipboard
Instrumentation of custom JDBC database driver
Hello,
We have a custom database driver that hides some complexity (sharding, loadbalancing, etc) over our MSSQL servers and we've noticed that the instrumentation from the DD agent isn't the same as if we were using the standard sqlserver driver.
We've traced the issue back to our connection string, since we register our driver with our-custom-driver, the connection string starts with jdbc:our-custom-driver:sqlserver://... that the datadog.trace.bootstrap.instrumentation.jdbc.JDBCConnectionUrlParser (understandably) can not parse, which leaves us with much less data on our span's than we'd normally would have. Notably we are missing the db.user and peer.hostname tags on query spans.
Further more, our driver will manage multiple connections under the hood using the standard sqlserver driver which are invisible at this point (we've found a release note which might explain this).
Is there a recommended way of enabling instrumentation of custom drivers and the wrapped connections?
We are using v0.101.0 at the moment.