DataSource Proxy + Spring Could Sleuth not working
adityazagade opened this issue · 4 comments
Describe the bug
SpringBoot version: 2.7.3
SpringCloud version: 2021.0.9
spring-cloud-starter-sleuth version: 3.1.10
Datasource Proxy version: 1.8.1
I have added these dependencies as mentioned in the documentation. However there is no logging. On application start-up, I see following errors:
[restartedMain] INFO org.springframework.cloud.context.scope.GenericScope - BeanFactory id=8f920f04-2bb9-3e6a-8e99-4005c6d97d36
[restartedMain] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration' of type [org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[restartedMain] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[restartedMain] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'loadBalancerClientsDefaultsMappingsProvider' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration$$Lambda$517/0x00000008013208a8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[restartedMain] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'defaultsBindHandlerAdvisor' of type [org.springframework.cloud.commons.config.DefaultsBindHandlerAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[restartedMain] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'spring.sleuth.jdbc-org.springframework.cloud.sleuth.autoconfig.instrument.jdbc.TraceJdbcProperties' of type [org.springframework.cloud.sleuth.autoconfig.instrument.jdbc.TraceJdbcProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Isolated the test case here:
https://github.com/adityazagade/sleuth-bug
If it is out of oss support, can you pls suggest a work-around?
If I remove sleuth from my dependencies, and instead add the following, I see the trace logs
<dependency>
<groupId>com.github.gavlyukovskiy</groupId>
<artifactId>datasource-proxy-spring-boot-starter</artifactId>
<version>1.8.1</version>
</dependency>
I think there is some problem with 'TraceDataSourceDecoratorBeanPostProcessor' as I follow what's mentioned here:
After spending enough time, I realised that this is not a bug. Presence of such warning does not mean that it's an issue.
I was able to get logs by adding right set of properties in application.yml
spring.sleuth.jdbc.enabled=true
spring.sleuth.jdbc.datasource-proxy.enabled=true
spring.sleuth.jdbc.datasource-proxy.slow-query.enable-logging=true
spring.sleuth.jdbc.datasource-proxy.slow-query.threshold=10000
spring.sleuth.jdbc.datasource-proxy.slow-query.log-level=DEBUG
spring.sleuth.jdbc.datasource-proxy.query.enable-logging=true
spring.sleuth.jdbc.datasource-proxy.query.log-level=DEBUG
logging.level.net.ttddyy.dsproxy.listener=DEBUG
spring.sleuth.jdbc.datasource-proxy.multiline=true