gavlyukovskiy/spring-boot-data-source-decorator

Cannot get statistics for connection, query, fetch in zipkin

xiul opened this issue · 2 comments

xiul commented

Hi, this is not a bug but more likely a configuration problem.

Today I configure a spring boot instance with your starter using flexy pool, by adding in pom.xml:

        <dependency>
            <groupId>com.github.gavlyukovskiy</groupId>
            <artifactId>flexy-pool-spring-boot-starter</artifactId>
            <version>1.7.0</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
            <version>2.2.7.RELEASE</version>
        </dependency>
        <!--flexy-pool fin -->

I test and autowire datasource and found is instance of DecoratedDataSource and HikariDataSource, and its working, then in properties add this lines:

spring.zipkin.base-url=http://localhost:9411/
decorator.datasource.flexy-pool.acquiring-strategy.increment-pool.max-overflow-pool-size=15
decorator.datasource.flexy-pool.acquiring-strategy.increment-pool.timeout-millis=500
decorator.datasource.flexy-pool.acquiring-strategy.retry.attempts=2
decorator.datasource.flexy-pool.metrics.reporter.jmx.enabled=true
decorator.datasource.flexy-pool.metrics.reporter.jmx.auto-start=false
decorator.datasource.flexy-pool.metrics.reporter.log.millis=300000
decorator.datasource.flexy-pool.threshold.connection.acquire=50
decorator.datasource.flexy-pool.threshold.connection.lease=1000

but when cheking zipkin output just notice no data for connection, query and fetch like in your sample image, next image show you my point:

image

What is missing in my config or what I'm doing wrong?

Thanks in advance for your help.

Flexy-pool support does not have Sleuth integration: https://github.com/gavlyukovskiy/spring-boot-data-source-decorator#spring-cloud-sleuth

You have to use datasource-proxy or p6spy for that.

In addition to what @chadlwilson said, if you want to have flexy-pool functionality (like automatic pool resize) and tracing at the same time, then you can use both decorators together - p6spy + flexy-pool or datasource-proxy + flexy-pool,