Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async baggage propagation failed after baggage is closed when using Brave #879

Open
wapkch opened this issue Oct 28, 2024 · 0 comments
Open

Comments

@wapkch
Copy link

wapkch commented Oct 28, 2024

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);
                }
            });
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant