0

How to trace Kafka based events using Spring Cloud sleuth? Whatever examples I saw were for rest APIs. I am looking for kafka-clients library.

Also is it a good idea to use Spring cloud sleuth for this or should I pass my traceIds via headers manually?

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

From the Spring Cloud Sleuth documentation here it says that the integration is provided with Kafka Streams ( Sleuth internally uses library Brave for instrumentation). The property through which this can be enabled/disabled is spring.sleuth.messaging.kafka.streams.enabled ( true/false)

We instrument the KafkaStreams KafkaClientSupplier so that tracing headers get injected into the Producer and Consumer's. A KafkaStreamsTracing bean allows for further instrumentation through additional TransformerSupplier and ProcessorSupplier methods.

For an example configuration/code you can take a look here.

Shailendra
  • 8,874
  • 2
  • 28
  • 37