Skip to content
Snippets Groups Projects
Commit f87ef818 authored by 邹毅贤's avatar 邹毅贤
Browse files

mod grpc tracing

parent 8148dab4
No related branches found
No related tags found
No related merge requests found
......@@ -53,9 +53,7 @@ func NewClient(url common.URL) *Client {
tracer = opentracing.GlobalTracer()
conn, err = grpc.Dial(url.Location, grpc.WithInsecure(), grpc.WithBlock(),
grpc.WithUnaryInterceptor(
otgrpc.OpenTracingClientInterceptor(tracer, otgrpc.LogPayloads())),
grpc.WithStreamInterceptor(
otgrpc.OpenTracingStreamClientInterceptor(tracer, otgrpc.LogPayloads())))
otgrpc.OpenTracingClientInterceptor(tracer, otgrpc.LogPayloads())))
if err != nil {
panic(err)
}
......
......@@ -73,8 +73,7 @@ func (s *Server) Start(url common.URL) {
// if global trace instance was set , then server tracer instance can be get. If not , will return Nooptracer
tracer := opentracing.GlobalTracer()
server = grpc.NewServer(
grpc.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer)),
grpc.StreamInterceptor(otgrpc.OpenTracingStreamServerInterceptor(tracer)))
grpc.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer)))
key := url.GetParam(constant.BEAN_NAME_KEY, "")
service := config.GetProviderService(key)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment