9

We are trying to implement Spring cloud sleuth with Zipkin in our project and wanted to know if Spring cloud sleuth will support DB calls with Spring data JPA.

I want to trace the time taken for DB calls just like service calls

When I make a service call with RestTemplate, that gets sent to zipkin and I am able to see that on the dashboard

But DB interactions with Spring data jpa is not getting displayed in Zipkin

RDR
  • 473
  • 4
  • 15

1 Answers1

1

You can use the new Dalston feature of using annotations on Spring Data repositories. You can check out this for more info http://cloud.spring.io/spring-cloud-sleuth/spring-cloud-sleuth.html#_managing_spans_with_annotations

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32
  • Thanks! But doesn't that mean we have to add the annotation for every JPA interface method. Is there any other way? – RDR Mar 25 '17 at 16:18
  • You can write an aspect to wrap all of these. I don't actually think it's sth that you'd want to do though. Are you really interested in tracing everything? – Marcin Grzejszczak Mar 25 '17 at 16:22
  • I guess using class level annotations (which isn't currently possible) would be handy for such case: https://github.com/spring-cloud/spring-cloud-sleuth/issues/772 – Matheus Santana Nov 14 '17 at 12:42
  • 1
    Yeah, currently I've removed it from classes. We might consider adding it in the future. – Marcin Grzejszczak Nov 14 '17 at 12:43