add tracing logs in server side and client side

This commit is contained in:
kevin
2020-09-22 17:34:39 +08:00
parent 797a90ae7d
commit be9c48da7f
13 changed files with 127 additions and 45 deletions

View File

@@ -17,6 +17,7 @@ type (
}
rpcServer struct {
name string
*baseRpcServer
}
)
@@ -40,6 +41,7 @@ func NewRpcServer(address string, opts ...ServerOption) Server {
}
func (s *rpcServer) SetName(name string) {
s.name = name
s.baseRpcServer.SetName(name)
}
@@ -50,6 +52,7 @@ func (s *rpcServer) Start(register RegisterFn) error {
}
unaryInterceptors := []grpc.UnaryServerInterceptor{
serverinterceptors.UnaryTracingInterceptor(s.name),
serverinterceptors.UnaryCrashInterceptor(),
serverinterceptors.UnaryStatInterceptor(s.metrics),
serverinterceptors.UnaryPromMetricInterceptor(),