EickMing commented on issue #3762:
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/3762#issuecomment-1525120800

   > ```
   > 我看唯一框架有修改traceId的地方就是这里 你断点点在这里看看这里是啥时候被走的吧   
https://github.com/apache/servicecomb-java-chassis/blob/1.0.0-m1/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/tracing/TracingFilter.java
   > ```
   
   这个过滤器存在于common-rest的包里,在目前使用的CSE商业版中已经找不到了。
   
在开始RPC调用时,会经过ZipkinTracingHandler,ZipkinTracingHandler里的handler方法调用ZipkinTracingDelegate的createSpan(invocation)方法,这个方法的实现是ZipkinConsumerDelegate的createSapn();
   下图是调用的链路:
   
![image](https://user-images.githubusercontent.com/20539987/234803641-c9877c47-d012-43cc-bf4c-f4a4ad1b3693.png)
   在这里调用了brave包中的HttpClientHandler的方法,一下三张图是方法调用路径
   
![image](https://user-images.githubusercontent.com/20539987/234803671-64079764-44f9-4373-ad11-0177954446ea.png)
   
![image](https://user-images.githubusercontent.com/20539987/234803692-1565f5e0-b3ce-4515-a900-6ff99b059e35.png)
   
![image](https://user-images.githubusercontent.com/20539987/234803725-6693cd6d-c03c-4f81-b79e-69fd07b332e7.png)
   第三张图中的方法的nextSpan生成了Span对象,以下2张图是进入方法内部的逻辑
   
![image](https://user-images.githubusercontent.com/20539987/234804686-7ee71942-37dc-4a09-80fc-5fd918a13f35.png)
   
![image](https://user-images.githubusercontent.com/20539987/234804713-aa480ccf-ca11-4c8f-b3a4-ced545ae94a3.png)
   生成Span以后,回到HttpClientHandler的handlerSend方法,
   
![image](https://user-images.githubusercontent.com/20539987/234805490-49e0a411-3ea6-460b-a338-64e44866f2c6.png)
   
![image](https://user-images.githubusercontent.com/20539987/234805784-56ccb1bb-7cf7-49ee-915b-5a5cc8119727.png)
   在B3Propagation的inject方法中将X-B3-SpanId存入invocation
   
   
   
   
   
   


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