Skip to content

[Bug] webflux trace is seperated,there are mutilple traces but actual is only one trace #12817

Closed
apache/skywalking-java
#788

Description

@wild46cat

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

OAP server (apache/skywalking)

What happened

when I use skywaling to trace webflux ,I found that if the return type is Mono ,then the trace is broken.
like this:
image

as the screenShot shows that:
what I need is opeartion from web request to redis,is only one trace.

this is my code:
@GetMapping("/getValue")
public Mono getValue() {
return redisTemplate.opsForValue().get("test").doOnSuccess(result -> System.out.println("Data read from Redis: " + result));
}

What you expected to happen

What I expected is that it could be only one trace, not seperate.
only show the webflux request is best (I know I could remove the plugin mvc-annotation in plugins folder).

How to reproduce

every time.

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Activity

  1. added
    bugSomething isn't working and you are sure it's a bug!
    on Dec 1, 2024
  2. changed the title [-][Bug] [/-] [+][Bug] webflux trace is seperated,there are mutilple traces but actual is only one trace[/+] on Dec 1, 2024
  3. added
    duplicateThis issue or pull request already exists
    questionEnd user question and discussion.
    and removed
    bugSomething isn't working and you are sure it's a bug!
    on Dec 1, 2024
  4. added this to the Java - 9.4.0 milestone on Dec 1, 2024
  5. wild46cat commented on Dec 2, 2024

    @wild46cat
    Author

    I had readed the document.
    but there is still problem.
    image

    as the picture shown:
    lettuce can't be merged into the the same trace.

    here is my code:
    @GetMapping("getValue12")
    public Mono getValue12() {
    return Mono.subscriberContext()
    .flatMap(ctx -> WebFluxSkyWalkingOperators.continueTracing(ctx, () -> {
    return redisTemplate.opsForValue().get("test");
    }));
    }

    I think maybe I have found a problem about webflux.

  6. wild46cat commented on Dec 2, 2024

    @wild46cat
    Author

    by the way, I have removed
    apm-springmvc-annotation-3.x-plugin-9.3.0
    apm-springmvc-annotation-4.x-plugin-9.3.0
    apm-springmvc-annotation-5.x-plugin-9.3.0
    apm-springmvc-annotation-6.x-plugin-9.3.0
    apm-springmvc-annotation-commons-9.3.0

    these jars into option-plugins folder ,did this have effect?

  7. wu-sheng commented on Dec 2, 2024

    @wu-sheng
    Member

    Personally, I don't know this as I am not working in Java application for a long time. Also, plugins are complex in Java ecosystem, there are various use cases.

    Still, when you find out a plugin issue, you need to debug the codes and find out why. Usually case like this is caused by thread-switch issue. The plugins don't cover all cases.

    But we don't have people to debug all plugins, as we are the ones wrote these. They are from world wide. We just verify through provided plugin test cases, nothing more.

  8. wild46cat commented on Dec 2, 2024

    @wild46cat
    Author

    I really appreciate your honesty. I will carefully debug and try to find the cause of the problem.

  9. wu-sheng commented on Feb 24, 2026

    @wu-sheng
    Member

    I really appreciate your honesty. I will carefully debug and try to find the cause of the problem.

    This has been resolved by @wuwen5 via apache/skywalking-java#788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsquestionEnd user question and discussion.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions