We're currently using Spring Kafka to send events between our Spring Boot based services. We're interested in propagating traces with Kafka messages so that we can correlate actions across our distributed system.
For example:
1. A client makes a POST request to our REST endpoint /api/example in WebFlux-based Service A. As a result of the POST call, Service A produces a message to example-kafka-topic.
2. Service B consumes messages from example-kafka-topic and makes REST calls to /api/something using WebClient.
The trace generated (or derived from HTTP headers) at the initial REST call is currently not propagated to the second REST call or anything else downstream. This is makes it difficult to correlate the effect of the second REST call with the initial REST call. Perhaps the trace should be included in the Kafka headers (like the HTTP headers), and automatically handled by KafkaTemplate and KafkaListener.
Comment From: wilkinsona
Spring Kafka is managed as a separate project and the functionality you've described is out of Spring Boot's control. I believe it should already be supported if you enable observations. If you have further questions, please follow up with the Spring Kafka team.