Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataSource Proxy + Spring Could Sleuth not working #2337

Closed
adityazagade opened this issue Jan 13, 2024 · 4 comments
Closed

DataSource Proxy + Spring Could Sleuth not working #2337

adityazagade opened this issue Jan 13, 2024 · 4 comments

Comments

@adityazagade
Copy link

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

@adityazagade
Copy link
Author

If it is out of oss support, can you pls suggest a work-around?

@adityazagade
Copy link
Author

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>

@adityazagade
Copy link
Author

I think there is some problem with 'TraceDataSourceDecoratorBeanPostProcessor' as I follow what's mentioned here:

https://stackoverflow.com/questions/1201726/tracking-down-cause-of-springs-not-eligible-for-auto-proxying

@adityazagade
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants