0

I'm running a Spring Boot app using:

  • Spring Boot 2.3.8
  • Spring Cloud Hoxton.SR10

I've declared the spring-cloud-starter-zipkin and spring-cloud-starter-openfeign dependencies, and have configured my app to point to a Zipkin server. Its a pretty vanilla setup and configuration (I also declare the spring-cloud-starter-netflix-ribbon and spring-cloud-starter-kubernetes-all dependencies o allow Spring Feign to use k8s service discovery).

My app declares a @SpringFeign annotated interface with a method to call to a remote service S.

So generally zipkin is getting spans from my app (for e.g. incoming REST calls) and B3 headers are being propagated via HTTP to the service S being called through feign.

But zipkin does not report a span from my app representing the Feign call to S. Is that something that should "just happen", or am I missing a piece of the puzzle?

I can e.g. add @NewSpan to the feign interface method, but that doesn't give me HTTP details for the request/response as span tags. And I rather not do that if this is supposed to work out of the box.

wabrit
  • 217
  • 2
  • 14

1 Answers1

0

This should be done out of the box: https://docs.spring.io/spring-cloud-sleuth/docs/2.2.7.RELEASE/reference/html/#feign

You can take a look at the feign sample (you need to go back in the history, currently it is for 3.x): https://github.com/spring-cloud/spring-cloud-sleuth/tree/master/spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-feign

In order to see if propagation works, look into the outgoing request, it should contain the tracing-related headers.

Jonatan Ivanov
  • 4,895
  • 2
  • 15
  • 30
  • Thanks Jonatan - to clarify, propagation of b3 info through HTTP headers via feign to another app is working fine; what I'm interested in is having spans sent from my app to zipkin when a feign client is called. – wabrit Mar 04 '21 at 20:18