Skip to content

TraceContext.getCorrelation() cannot obtain the value #13385

Closed

Description

@shining-stars-l

Search before asking

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

Apache SkyWalking Component

Java Agent (apache/skywalking-java)

What happened

  1. In Gateway, the filters use TraceContext.putCorrelation to place custom IDs.
String custom_request_id = request.getHeaders().getFirst("custom_request_id");
if (StringUtil.isNotEmpty(custom_request_id)) {
    TraceContext.putCorrelation("custom_request_id", custom_request_id);
}
  1. In the subsequent user services, the custom ID cannot be obtained.
Optional<String> op = TraceContext.getCorrelation("custom_request_id");

What you expected to happen

I think it's because of Gateway's webflux. Because for regular services, such as when the user service calls TraceContext.putCorrelation, and then through Feign calls the order service, the order service can obtain it.

How to reproduce

  • springboot:2.3.12.RELEASE
  • gateway:2.2.9.RELEASE
  • skywalking-java-agent:9.3.0

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
    bug
    on Jul 28, 2025
  2. wu-sheng commented on Jul 28, 2025

    @wu-sheng
    Member

    If this gets lost, I think the trace should be broken too. It could be caused by Feign or some framework?

  3. added
    java
    plugin
    on Jul 28, 2025
  4. locked and limited conversation to collaborators on Jul 28, 2025
  5. converted this issue into a discussion #13386 on Jul 28, 2025
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

    bugjavaplugin

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions