Spring-cloud-sleuth: Add JDBC instrumentation

Created on 7 Sep 2017  路  8Comments  路  Source: spring-cloud/spring-cloud-sleuth

enhancement help wanted

Most helpful comment

I have created a library that is proxying your DataSource with one of the jdbc instrumentation libraries such as p6spy.
It as well integrates with sleuth and registers listener that is very similar to the one from brave-instrumentation-p6spy, but mine is also creating span for each connection taken from the DataSource and query span includes time to close ResultSet if query returns it.

In zipkin it looks great:
zipkin
You can find more screenshots and try it on library page.

All 8 comments

Other than add JDBC instrumentation, may be can intercept Spring Data Repositories and Templates.

You can already use the Spring Data Repositories together with Sleuth's annotations.

But cannot add annotations on methods like save(), findOne()

Why? You can inherit a method in your interface and annotate it

Yes, but a little ugly.

I have created a library that is proxying your DataSource with one of the jdbc instrumentation libraries such as p6spy.
It as well integrates with sleuth and registers listener that is very similar to the one from brave-instrumentation-p6spy, but mine is also creating span for each connection taken from the DataSource and query span includes time to close ResultSet if query returns it.

In zipkin it looks great:
zipkin
You can find more screenshots and try it on library page.

That looks awesome @gavlyukovskiy . Let's do it like this. Everyone who is interested in this feature please try the https://github.com/gavlyukovskiy/spring-boot-data-source-decorator library. Once we get more parties involved and happy with the library we'll think of putting it in the core of Sleuth.

Closing this in favour of Brave's p6spy instrumentaiton - https://github.com/openzipkin/brave/tree/master/instrumentation/p6spy#brave-instrumentation-p6spy

Was this page helpful?
0 / 5 - 0 ratings