Hi,

I'm currently testing the new Hooks.enableAutomaticContextPropagation(); and am getting missing trace IDs in any project with Spring Data (Mongo and Redis)

https://github.com/davidmelia/spring-boot-kafka-consumer-tracing/tree/spring_data_mongo_trace_issue shows the problem where hitting http://localhost:8080/home gives

INFO [aid=spring-boot-kafka-consumer-tracing,tid=63f8dcaf43b4584810874449c7f8e250,sid=10874449c7f8e250,cusname=] 88765 --- [ctor-http-nio-2] com.example.demo.HomeController          : has a trace id
INFO [aid=spring-boot-kafka-consumer-tracing,tid=,sid=,cusname=] 88765 --- [ntLoopGroup-3-3] com.example.demo.HomeController          : does not have a trace id
@RestController
@Slf4j
public class HomeController {

  @Autowired
  private CustomerRepository repository;

  @GetMapping(value = "/home", produces = MediaType.APPLICATION_JSON_VALUE)
  public Mono<Map<Object, Object>> sendMessage() {
    log.info("has a trace id");
    return repository.findByFirstName("Alice").map(c -> {
      log.info("does not have a trace id");
      return Map.of(c.firstName, c.lastName);
    });


  }

}

While this is spring data I wonder if this issue is more fundamental?

Thanks

Comment From: mhalbritter

Thanks for the report. I've asked the context propagation / reactor team for feedback.

Comment From: mhalbritter

Hey, have you used handle/tap before and the logs were working but with the new one it’s not happening? If yes, then it's a bug. It also depends on what Data MongoDB does with the executor. Please open that issue on the Spring Data MongoDB tracker for further investigation and please link back to this ticket. Thanks!

Comment From: mhalbritter

Just got an update from reactor team: this issue will be automatically fixed once https://github.com/reactor/reactor-core/issues/3366 is implemented.