Closed as not planned
Description
When using micrometer-tracing-bridge-brave
, async baggage propagation not work after the BaggageInScope has closed, but if using micrometer-tracing-bridge-otel
, it worked.
Here is an example:
@GetMapping
public void test() {
ExecutorService executorService = ContextExecutorService.wrap(Executors.newCachedThreadPool(), ContextSnapshot::captureAll);
try (BaggageInScope baggage = tracer.getBaggage("xyz").makeCurrent("123")) {
executorService.execute(() -> {
try {
Thread.sleep(3000);
String s = tracer.getBaggage("xyz").get();
Assert.state(s.equals("123"), "Baggage should be propagated"); // work when using otel, not work when using brave
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
});
}
}