如何调试 gRPC-Go 服务?

huangapple go评论137阅读模式
英文:

How do I debug gRPC-Go services?

问题

使用gRPC-Go无疑是构建弹性、高性能和可扩展分布式系统的好方法。我不太明白的是如何实际调试使用它编写的服务。此外,HTTP/2是唯一支持的传输协议吗?

英文:

Using gRPC-Go is certainly a good way to build resilient, performant and scalable distributed systems. What I don't quite get is how to actually debug services written with it. Also, is HTTP/2 the only wire protocol supported?

答案1

得分: 2

不确定你是否已经找到解决方案...但是根据你的应用程序中有多少个服务,你可以使用分布式跟踪系统来记录服务之间的调用。其中一些系统包括:

  • Zipkin(http://zipkin.io/)
  • Dapper(https://research.google.com/pubs/pub36356.html)
  • Jaeger(https://uber.github.io/jaeger/)

如果你使用opentracing项目(http://opentracing.io/),你可以将跟踪代码抽象出来,使其与传输信息到跟踪系统的代码分离。例如,你可以使用OpenTracing的跟踪语句来对客户端和服务器进行仪器化,然后可以切换跟踪实现,使用Zipkin或Jaeger Tracer以正确的格式推送跟踪信息。

gRPC已经准备好使用opentracing绑定。https://github.com/grpc-ecosystem/grpc-opentracing

英文:

Not sure if you've found a solution yet...but depending on how many services you have in your Application, you can use a distributed tracing system to record calls between services. Some of these systems include:

If you use the opentracing project (http://opentracing.io/), you can abstract your tracing code in your client and server from the code that transmits information to the Tracing System. For example, you can instrument your client and servers with Trace statements from OpenTracing, and then you can switch out your trace implementation for a Zipkin or Jaeger Tracer that pushes traces in the correct format.

There are opentracing bindings for gRPC reay to use. https://github.com/grpc-ecosystem/grpc-opentracing

huangapple
  • 本文由 发表于 2016年11月25日 23:44:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/40808467.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定