apache / servicecomb-java-chassis

ServiceComb Java Chassis is a Software Development Kit (SDK) for rapid development of microservices in Java, providing service registration, service discovery, dynamic routing, and service management features
Apache License 2.0
1.91k stars 812 forks source link

What about to support zipkin tracing in spring-cloud-gateway in java-chassis? #1116

Closed zaneChou1 closed 4 years ago

zaneChou1 commented 5 years ago

As we known, when users using spring-cloud-gateway in java-chassis, they cannot tracing the gateway service. And I have find that tracing zuul in java-chassis has been supported, so I am going to support tracing spring-cloud-gateway in java-chassis.

Any other thoughts?

zenlint commented 5 years ago

@wujimin @WillemJiang What about your opinion, I think we are encourage that if @bettermanzzy are trying to do that.

WillemJiang commented 5 years ago

Please go ahead, we can do the same thing for the spring-cloud-gateway as we do with the spring-cloud-zuul to bridge the request information with java chassis.

zaneChou1 commented 5 years ago

OK, thanks for @zenlinTechnofreak @WillemJiang supporting it. I'm ready to try it !

wujimin commented 5 years ago

because forward logic of zuul or spring cloud gateway is not controlled by ServiceComb so i think we no need to do anything for these cases just use spring modules directly and enhance handlers/handler-tracing-zipkin to inherit spans from http header like inherit traceId in org.apache.servicecomb.core.Invocation#initTraceId(org.apache.servicecomb.core.tracing.TraceIdGenerator)

if this enhance can resolve the problem, then we can delete following module: java-chassis-spring-boot/spring-boot-starter/spring-cloud-zuul-zipkin

zaneChou1 commented 5 years ago

Good idea! I am looking forward to the enhancement handler / handler-tracing-zipkin. By the way, Is this enhance going on? Is there any plan?

wujimin commented 5 years ago

i know this issue but no time to resolve it, :(

It would be great if you can enhance it. i will create one jira task and assign it to you?

zaneChou1 commented 5 years ago

yep, this is a valuable thing. I am willing to do it . but now, I have no idea to resolve it. I am worried that I can't solve it. Do you have any solution?

wujimin commented 5 years ago

great~ i will create the task, and describe the proposal in it.

wujimin commented 5 years ago

https://issues.apache.org/jira/browse/SCB-1197

zaneChou1 commented 5 years ago

I have seen your describe in SCB-1197. But when I try to do it. I find gateway cannot pass handler chain, though I add handler-tracing-zipkin in dependency and start handler chain in microservice.yaml. I don't know if there are other way to make gateway pass handler chain. I think if gateway cannot pass handler chain, it may not be tracked by enhancing handler-tracing-zipkin. what do you think ?

wujimin commented 5 years ago

as we discussed before, gateway(zuul/springcloud gateway) no need to add servicecomb logic, just use zipkin modules for them directly

after that, zuul/springcloud gateway will forward request to internal microservice with zipkin http headers, internal microservice enable handler-tracing-zipkin to inherit zipkin data from header to CseContext. maybe this can work.