You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/04/13 02:36:43 UTC

[GitHub] [skywalking] wallezhang edited a comment on issue #6730: pulsar plugin breaks trace on the consumer size

wallezhang edited a comment on issue #6730:
URL: https://github.com/apache/skywalking/issues/6730#issuecomment-818381991


   > @wallezhang Seems the problem is related to passing the span across threads. Have you tried to get the `ContextCarrier` from the properties of the message?
   > 
   > ```
   > ContextCarrier carrier = new ContextCarrier();
   >             CarrierItem next = carrier.items();
   >             while (next.hasNext()) {
   >                 next = next.next();
   >                 next.setHeadValue(msg.getProperty(next.getHeadKey()));
   >             }
   > ```
   > 
   > Then you can use the carrier to create a span or other operations
   > 
   > ```
   > ContextManager.createEntrySpan(<operationName>, carrier);
   > ```
   
   Why not pass the span in the message across the thread? E.g. enhance the `callMessageListener` method, which is already in the listener thread, so that we can directly pass the span in the message


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org