Open Danny5487401 opened 1 year ago
I think you can use a middleware to convert x-client-trace-id to Traceparent in HTTP headers.
is there any example code to learn from because i do not know too much about opentracing package with zipkin protocol?
I think you can use a middleware to convert x-client-trace-id to Traceparent in HTTP headers.
I tried to use the global middleware, but it will be executed later than the trace middleware and will not take effect
I think you can use a middleware to convert x-client-trace-id to Traceparent in HTTP headers.
I tried to use the global middleware, but it will be executed later than the trace middleware and will not take effect
@yluchao it seems to be ok to use chain to change middleware order.
MustNewServer(RestConf{}, WithChain(chain.New(middleware1(), middleware2())))
But it will lose original middleware because local-scoped chain is hard to configure. @kevwan
Any updates?
I need this feature too, and I'd like to build a solution if time permits.
@ofey404 Not too much time to build by my own, hope somebody can。 @kevwan it will be ok to set extra context middleware with istio trace id before go-zero TraceHandler
@kevwan would u consider adding some weight to middleware so that they can be added before default middleware ?
or another simple solution below : https://github.com/zeromicro/go-zero/pull/4364/files
func (ng *engine) bindRoute(fr featuredRoutes, router httpx.Router, metrics *stat.Metrics,
route Route, verifier func(chain.Chain) chain.Chain) error {
chn := ng.chain
if chn == nil {
chn = chain.New()
}
if ng.conf.AddNativeMiddleWare{
buildChainWithNativeMiddlewares(chain chain.Chain,fr featuredRoutes, route Route,metrics *stat.Metrics)
}
}
I want to have the same trace-id from istio ingress gateway or sicar envoy as that in go-zero application. Is it possible to extract from it by configuring?
example