reactor-kafka icon indicating copy to clipboard operation
reactor-kafka copied to clipboard

Micrometer tracing context propagation problem

Open mzalewski82 opened this issue 1 year ago • 1 comments

Expected Behavior

ParentID should be propagated correctly, so full trace can be visualized in Jaeger.

Actual Behavior

TraceID is preserved but ParentID is lost which leads to flat span tree in Jaeger. Moreover there's a ParentID reported in Jaeger as missing which is visible in the logs.

It looks like some intermediate span(s) is not propagated to Jaeger correctly.

Steps to Reproduce

Please have a look at this simple example. https://github.com/mzalewski82/reactor-kafka-tracing It contains 2 Spring Boot apps. web which is exposing a REST API. Data received through this API is saved in MongoDB using Spring Data reactive repo (context propagation is ok here). Same data is pushed to Kafka 'kafka-reactor-clientreads this data from 'Kafka' using 2 different clients. One is usingKafkaReceiver another one 'ReactiveKafkaConsumerTemplate. Both share the same tracing parent propagation problem.

  1. Run infra using attached docker-compose file.
  2. Run both apps
  3. Call http://localhost:8080/hello?name=NiceName
  4. Check Jaeger http://localhost:16686

Your Environment

  • Reactor version(s) used: 3.6.2
  • Other relevant libraries versions (eg. netty, ...): Spring Boot 3.2.2, reactor-kafka 1.3.22
  • JVM version (java -version): 17 zulu or 21 graalvmce
  • OS and version (eg uname -a): macOS Sonoma 14.3.1

mzalewski82 avatar Feb 16 '24 10:02 mzalewski82

Upvote

KafkaProServerless avatar Feb 18 '24 06:02 KafkaProServerless