You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/12/20 06:18:55 UTC

[GitHub] [dubbo] songxiaosheng opened a new issue, #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

songxiaosheng opened a new issue, #11172:
URL: https://github.com/apache/dubbo/issues/11172

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ## Describe the proposal
   <!-- Please use this for a concrete design proposal for functionality. -->
   <!-- If you just want to request a new feature and discuss the possible business value, create a Feature Request. -->
   
   En:Generally, in Java, traceid and spanid are passed through the thread context, but in the case of multi-threading, there will be multiple thread contexts. At this time, the chain will be lost when the same request reaches the child thread. At this time, we need to copy the link data from one thread to the context of another thread. If you don’t know how to copy, you can consider how to share data between threads, such as using shared variables such as member variables.
   
   中文:一般在Java中traceid和spanid我们都是通过线程上下文来传递的但是出现了多线程的情况下就会有多个线程上下文的情况,这个时候就会导致同一个请求中到了子线程时候丢失了链路追踪数据,这个时候就需要我们将链路数据从一个线程拷贝到另外一个线程的上下文中,如果不知道如何拷贝可以考虑下线程间是如何共享数据的比如使用成员变量这种共享变量
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by "ShenFeng312 (via GitHub)" <gi...@apache.org>.
ShenFeng312 commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1430969769

   dubbo 异步调用采用`org.apache.dubbo.rpc.protocol.dubbo.FutureAdapter` 包装了CompletableFuture 该类在dubbo-rpc-api 模块下 且相关代码都在api 模块下 如果要封装异步trace信息会强制依赖到相关组件,所以我认为不应该默认实现  可以让用户用已下方式实现
   ```java
   public class ConsumerAsync {
   
       @DubboReference
       private DemoService demoService;
   
       @Resource
       private ObservationRegistry observationRegistry;
   
       public String doSayHello(String name) throws ExecutionException, InterruptedException {
           CompletableFuture<String> stringCompletableFuture = demoService.sayHelloAsync(name);
           Observation currentObservation = observationRegistry.getCurrentObservation();
           stringCompletableFuture.whenComplete((s, throwable) -> Observation.tryScoped(currentObservation,
               ()-> System.out.println(s)));
           return stringCompletableFuture.get();
       }
   }
   ```


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] songxiaosheng closed issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng closed issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)
URL: https://github.com/apache/dubbo/issues/11172


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by GitBox <gi...@apache.org>.
ShenFeng312 commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1367690220

   > > 如何参与贡献?
   > 
   > 可以留下钉钉号吗,方便我们联系
   
   shenfeng970312


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] songxiaosheng commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by GitBox <gi...@apache.org>.
songxiaosheng commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1359007122

   > 如何参与贡献?
   
   可以直接认领任务,后续我们一起沟通,会把任务指派给你


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by GitBox <gi...@apache.org>.
ShenFeng312 commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1359014192

   > > 如何参与贡献?
   > 
   > 可以直接认领任务,后续我们一起沟通,会把任务指派给你
   
   我希望参与和trace 这块相关的内容。thanks


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] conghuhu commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by GitBox <gi...@apache.org>.
conghuhu commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1362786067

   > 如何参与贡献?
   
   可以留下钉钉号吗,方便我们联系


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by GitBox <gi...@apache.org>.
ShenFeng312 commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1359013592

   我希望参与和trace 这块相关的内容 thanks


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by GitBox <gi...@apache.org>.
ShenFeng312 commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1359004447

   如何参与贡献?


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] songxiaosheng commented on issue #11172: Observability tasks: trace delivery across threads(跨线程时的trace数据传递)

Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on issue #11172:
URL: https://github.com/apache/dubbo/issues/11172#issuecomment-1432237692

   可以的 到时候我们可以把这一部分增加到官方文档提供一种解决方案


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org