spring-bootspring-dataspring-cloud-sleuthzipkin

Sleuth not able to generate traces for JDBCTemplate access


I am exploring slueth for enabling tracing in our Apps. I get the API to API call logs in zipkin but I don't get any other JDBC calls logged. I have added below to my application.yml

spring:
  sleuth:
    jdbc:
      # enable logging for datasource-proxy
      datasource-proxy:
        query:
          enable-logging: true

I have also added below to my pom.xml

        <dependency>
            <groupId>net.ttddyy</groupId>
            <artifactId>datasource-proxy</artifactId>
            <version>${datasource-proxy.version}</version>
            <scope>runtime</scope>
        </dependency>

Did I miss something to enable the Zipkin traces for JDBC templates?


Solution

  • For now I was able to solve the issue by using below

            <dependency>
                <groupId>com.github.gavlyukovskiy</groupId>
                <artifactId>datasource-proxy-spring-boot-starter</artifactId>
                <version>1.8.0</version>
            </dependency>
    

    Instead of adding sleuth. I will work on a minimal example soon to see why Sleuth was not working