1
votes

We are building event-driven microservices using Spring Cloud Stream(with Kafka binder) and looking at options for tracing Micorservices that are not exposed as http end point. Please suggest.

I understand that using Sleuth will automatically add trace and span id to logs if it is over http. Documentation is not clear for using it with Spring Cloud Stream - https://cloud.spring.io/spring-cloud-sleuth/spring-cloud-sleuth#_messaging

Found an example but not sure whether it is the right approach - https://github.com/bjedrzejewski/food-order-publisher/blob/zipkin-example/src/main/java/com/e4developer/foodorderpublisher/FoodOrderController.java

Thanks

1

1 Answers

2
votes

Sleuth will do the same for messaging by using message headers to propagate span id, trace id and other relevant information. It does so by registering special channel interceptor.