3

We have been using spring cloud sleuth in our micoservices for tracing. We have also added enabled jdbc level spans from spring data Repository connection, fetch and query. I am seeing some weird jps traces of name jdbc:/datasource/connection which seem to include some of my service specific spans. I was of the view that a parent span includes only those spans as kids, which it calls.

enter image description here

venderproxy, profile:fetchorganization are my other services' grpc endpoints, why is jdbc:/datasource/connection span in supplier including some of my services under it?

v78
  • 2,803
  • 21
  • 44

1 Answers1

1

I got the answer from one of the author of p6spy.

jdbc:/datasource/connection span represents open connection (transaction), in this case you're most likely haven't closed the connection and calling other services? For example you might be calling other services from the method annotated with @Transactional. While it might be ok for some scenarios, it can cause issues with connection pool if you're holding connection open for 12s.

v78
  • 2,803
  • 21
  • 44
  • have you an example to setup spring cloud sleuth with p6spy please ? – Abdelghani Roussi Apr 05 '21 at 00:18
  • The library is `autoconfigured1, in itself, so you do not need any code, just addling the dependency in classpath is enough. Please follow the steps here: https://github.com/gavlyukovskiy/spring-boot-data-source-decorator. @AbdelghaniRoussi – v78 Apr 12 '21 at 03:14