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

Spring boot cloud gateway, context propagation broken #5186

Closed
dynatrace-peterlang opened this issue Jan 20, 2022 · 1 comment · Fixed by #5188
Closed

Spring boot cloud gateway, context propagation broken #5186

dynatrace-peterlang opened this issue Jan 20, 2022 · 1 comment · Fixed by #5188
Labels
bug Something isn't working repro provided

Comments

@dynatrace-peterlang
Copy link

dynatrace-peterlang commented Jan 20, 2022

Describe the bug
Since release v1.10.0 the context propagation of a reactor-core context within spring cloud gateway is broken. I would only expect one trace for my sample scenario, but since v.1.10.0 two traces are produced.

Steps to reproduce
In a controller for spring cloud gateway I use a flatMap operation to chain two web service calls.
Simplified sample code in gateway controller:

@GetMapping(value = "backendmap")
public Mono<Pojo> backendmap() {
    return requestPojo().flatMap(it -> requestMojo());
}

full reproducer in https://github.com/dynatrace-peterlang/springapigateway-reproducer

What did you expect to see?
For agents until version 1.9.2 in jaeger I observe one trace for the whole operation. Simplified structure:

unknown_service:java /controller/backendmap
    unknown_service:java ApiGatewayController.backendmap
    unknown_service:java HTTP GET
        unknown_service:java /controller/pojo
            unknown_service:java ApiGatewayController.getPojo
    unknown_service:java HTTP GET
        unknown_service:java /controller/mojo
            unknown_service:java ApiGatewayController.getMojo

What did you see instead?
With the new agent version 1.10.0 this trace is split up in two. It seems the context propagation in operation flatMap does not work anymore

unknown_service:java /controller/backendmap
    unknown_service:java ApiGatewayController.backendmap
    unknown_service:java HTTP GET
        unknown_service:java /controller/pojo
            unknown_service:java ApiGatewayController.getPojo

and a second trace

unknown_service:java HTTP GET
    unknown_service:java /controller/mojo
        unknown_service:java ApiGatewayController.getMojo

What version are you using?
broken since v1.10.0

Environment
Compiler: Eclipse Temurin 11 OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
OS: Windows

Additional context
It seems context propagation was broken by changes in #4786

@trask
Copy link
Member

trask commented Jan 27, 2022

@dynatrace-peterlang thanks for reporting this! it's now fixed in the 1.10.1 patch release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro provided
Projects
None yet
3 participants