1
2
3
4
5
6
7
8
9
10
11
12
13
14
func main() {
go startTrace()
}

func startTrace() {
grpc.EnableTracing = true

trace.AuthRequest = func(req *http.Request) (any, sensitive bool) {
return true, true
}

go http.ListenAndServe(":9503", nil)
log.Println("trace listen on 9503")
}
  • 通过http://localhost:9503/debug/requests查看请求
  • 通过http://localhost:9503/debug/events查看事件