在server端引入trace包
"golang.org/x/net/trace"
func startTrace() {
return true, true
}
grpclog.Info("Trace listen on 50051")
//打开trace开关
func init() {
grpc.EnableTracing = true
在main函数中调用开启trace
// 开启trace
go startTrace()