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

Regression: tracing context lost with WebTestClient #24191

Closed
beltram opened this issue Dec 11, 2019 · 1 comment
Closed

Regression: tracing context lost with WebTestClient #24191

beltram opened this issue Dec 11, 2019 · 1 comment
Assignees
Labels
for: external-project Needs a fix in external project

Comments

@beltram
Copy link

beltram commented Dec 11, 2019

Hi,
Once using Sleuth and injecting Tracing headers in a WebTestClient I was able to retrieve them in Reactor's context later on like this :

// Test
webTestClient.get()
    .uri("/api/tracing")
    .header("X-B3-TraceId", "463ac35c9f6413ad48485a3953bb6124")
    .header("X-B3-SpanId", "a2fb4a1d1a96d312")

// Controller
@GetMapping
    fun spanId(): Mono<String> {
        return Mono.subscriberContext()
                .filter { it.hasKey(Span::class.java) }
                .map { it[Span::class.java].context() }
                .map { it.spanIdString() }
    }

This worked with spring-test 5.2.1.RELEASE but no longer with 5.2.2.RELEASE.

What happens is that a new Span is created here because Context lacks original Span.

I think root cause comes from this commit or this one in HttpHandlerConnector.

I've setup a reproducer here. Thank you 😄

Affects: Spring Framework 5.2.2.RELEASE

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 11, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Dec 12, 2019

Even though the changes from #23936 clearly have this effect, that doesn't mean the root cause is in the Spring Framework. I don't see anything in our changes that should be problematic and I'm not familiar enough with how Sleuth is implemented to be able to debug or even reason about the issue.

So please create re-open this against Sleuth and also link the two so I can follow it. I'm quite happy to help figure out what the issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project Needs a fix in external project
Projects
None yet
Development

No branches or pull requests

3 participants