如何调试gRPC-Go服务?

使用 gRPC-Go 当然是构建弹性,高性能和可扩展的分布式系统的好方法。 我不太了解如何实际调试使用它编写的服务。 另外,HTTP / 2是唯一受支持的有线协议吗?</ p>

</ div>

展开原文

原文

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?

drhzc64482
drhzc64482 github.com/grpc/grpc-go/blob/master/transport/transport.go#L393该库似乎已硬编码为仅使用HTTP/2
接近 4 年之前 回复
doumei9832
doumei9832 抱歉,我的意思是没有一个,但我不确定100%
接近 4 年之前 回复
dsms21398
dsms21398 感谢@khuderm–这样,那么有替代写协议可用吗?
接近 4 年之前 回复
dongwei1895
dongwei1895 您可以通过将GRPC_TRACE环境变量设置为all来进行调试。至于HTTP/2,我认为这是出于安全性和可靠性方面的考虑。我可能是错的
接近 4 年之前 回复

1个回答



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

展开原文

原文

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

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐