2
1

More than 3 years have passed since last update.

GoでデバッグのためにgRPCのリクエストをトレースする

Posted at

Go で gRPC が使われているライブラリを使っている時に、ライブラリが投げている実際の gRPC のリクエストをトレースしたい場合には Go の gRPC ライブラリが golang.org/x/net/trace に対応している為、お手軽に確認する事ができる。

grpc.EnableTracing = true

go func() {
    http.ListenAndServe(":8080", nil)
}()

そのあと、 localhost:8080/debug/requests を開けば以下のような出力が得られる。

スクリーンショット 0002-01-10 17.35.25.png

詳細は golang.org/x/net/trace を確認してもらえれば。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1