liuhaolong10 opened a new issue, #13720:
URL: https://github.com/apache/skywalking/issues/13720

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   **Problem Description**
   When using the skywalking-java agent to collect trace data for RabbitMQ 
message production and consumption, two key issues persist:
   
   **1. TraceId disconnection between producer and consumer services**
       The trace links of RabbitMQ message production (by producer service) and 
consumption (by consumer service) cannot be connected through a single traceId.
       Example scenario:
   
       - Java Service A (producer) sends a RabbitMQ message.
   
       - Java Service B (consumer) consumes this message.
          Expected behavior: The entire call chain (Service A → RabbitMQ → 
Service B) should be connected via one unified traceId.
         Actual issue: The consumer thread in Service B fails to retrieve the 
skywalking-java traceId when consuming the RabbitMQ message, leading to 
disconnected trace links between Service A and Service B.
   
   **2. Incomplete consumer trace stack**
       The collected trace stack for the RabbitMQ consumer only shows a single 
layer named "rabbitmq", and does not attach the details of subsequent business 
operations (e.g., MySQL queries, Redis operations) associated with message 
consumption. (As shown in the attached screenshot below)
   
   <img width="2096" height="650" alt="Image" 
src="https://github.com/user-attachments/assets/9f4f9ec6-c7d1-49ab-9036-9acad688d7d7";
 />
   
   **Related Historical Issues**
   I searched the issue list and found two similar unresolved issues regarding 
RabbitMQ trace collection:
   
   - https://github.com/apache/skywalking/issues/11300
   
   - https://github.com/apache/skywalking/issues/7018
   
   **Solution Status**
   I have developed a complete solution for the above issues, and it has been 
fully tested to effectively resolve all the mentioned problems. (As shown in 
the attached screenshot below)
   
   <img width="2094" height="1032" alt="Image" 
src="https://github.com/user-attachments/assets/dda34f28-e495-438a-a389-7edd8315fb3a";
 />
   
   **Request for Guidance**
   Could you please guide me on the official process to submit the code patch 
for this fix? Specifically, I would like to know:
   
   - The target branch to submit the PR to (e.g., master, release-x.x)
   
   - Any coding standards or PR template requirements to follow
   
   - The code review process and key points to note
   
   
   ### What you expected to happen
   
   After troubleshooting the code of the RabbitMQ collection plugin, I found 
that the method intercepted by the instrumentation is executed in a thread pool 
dedicated to RabbitMQ message processing, which is not the same thread as the 
one where the consumer actually executes the business logic code. This thread 
inconsistency leads to the loss of trace information.
   
   ### How to reproduce
   
   Steps to Reproduce the Issue
   
   1. In a Java service, write code to send a RabbitMQ message.
   
   2. Then write code to consume the RabbitMQ message, and add a database query 
operation in the consumption logic.
   
   This is a 100% reproducible issue (consistently reproducible) and can be 
easily reproduced.
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [x] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to