搜索
您的当前位置:首页正文

golang grpc调用轨迹记录-trace

来源:二三娱乐

在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()

Top