@marcingrzejszczak @shakuzen and myself had discussions about providing better observability support for our users. One part of this effort is the ability of decorating DataSources so that other Spring components (e.g.: Sleuth) or the users themselves can build on top of this feature and have better insights to their DB integration.

At the moment, Spring Cloud Sleuth does not support JDBC instrumentation out of the box. We would like to use this decoration feature to instrument JDBC using third party libraries like P6Spy or Datasource Proxy. They can work with the default tracer (Brave) implementation of Sleuth so from the high-level perspective the JDBC instrumentation could look like: - Spring Framework: provides the ability to add decorators to JDBC DataSources (the issue is about this decoration capability) - Spring Boot: provides auto-configuration so that JDBC DataSources are decorated if there are decorators available - Spring Cloud Sleuth: provides decorators and auto-configuration for JDBC proxy libraries like P6Spy/Datasource Proxy

The benefit for the users is getting distributed tracing out-of-the-box for JDBC using Sleuth and the ability to decorate their datasources however they want without the need to add Sleuth.

There is a connected issue: https://github.com/spring-projects/spring-boot/issues/25032 and an existing project, spring-boot-data-source-decorator, maintained by @gavlyukovskiy. One way to provide better observability support is merging different parts of spring-boot-data-source-decorator into the various Spring projects (for Spring Framework, this would mean the decorator part).

Comment From: bclozel

I think this has been superseded by https://github.com/jdbc-observations