You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/06/28 06:38:26 UTC

[GitHub] ryphnyuan edited a comment on issue #722: ServiceComb的调用链默认是对接zipkin的,如何对接jaeger?

ryphnyuan edited a comment on issue #722: ServiceComb的调用链默认是对接zipkin的,如何对接jaeger?
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/722#issuecomment-400928071
 
 
   重新调测了一下,在启用了ServiceComb并去掉了spring原来的DispatcherServlet后,请求处理关键流程大致如下:
   @SpringBootApplication(exclude= {DispatcherServletAutoConfiguration.class, DataSourceAutoConfiguration.class})
   @EnableServiceComb
   
   1、进入io.opentracing.contrib.web.servlet.filter.TracingFilter,生成初始的span并将生成的span存入ThreadLocal。
   2、进入到org.apache.servicecomb.transport.rest.servlet.RestServlet,调用具体的服务,并通过org.apache.servicecomb.common.rest.AbstractRestInvocation.scheduleInvocation()丢入线程池执行具体的业务处理。
   3、通过RestTemplate,调用其他的服务。
   这个时候,虽然也进入到了io.opentracing.contrib.spring.web.client.TracingRestTemplateInterceptor的相关方法中,但是之前保存在ThreadLocal中的初始span获取不到了,因为已经不是同一个线程了,导致后续的span是分离的,无法形成一个完成的调用链。
   
   同时如果不使用ServiceComb,让请求走原来的org.springframework.web.servlet.DispatcherServlet,则不会出现这个问题,因为整个过程都是在一个线程中运行的,通过ThreadLocal能很好的处理这个初始span。
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services