简体   繁体   English

如何调试 pod 之间的 grpc 调用_

[英]How to debug grpc calls between pods_

I have two pods interact with each other using grpc, how to debug grpc calls between those two pods?我有两个 pod 使用 grpc 相互交互,如何调试这两个 pod 之间的 grpc 调用?

I already try to set:我已经尝试设置:

export GRPC_TRACE=all
export GRPC_VERBOSITY=DEBUG

then using kubectl logs <pod> -n namespces does not show up any grpc logs, how to debug grpc between pods?然后使用kubectl logs <pod> -n namespces不显示任何 grpc 日志,如何在 pod 之间调试 grpc?

It depends on what you want to debug: If you just want to know if there are communications on the Network, then you will have to add something outside of your 2 programs.这取决于您要调试的内容:如果您只想知道网络上是否有通信,那么您将不得不在您的 2 个程序之外添加一些东西。

If you are the developer of these programs, you can add middlewares to the gRPC clients/servers to add trace (eg, using OpenTelemetry tracing and Jaeger) to get cross-services traces (you can propagate traces IDs on the network).如果您是这些程序的开发人员,您可以将中间件添加到 gRPC 客户端/服务器以添加跟踪(例如,使用 OpenTelemetry 跟踪和 Jaeger)以获取跨服务跟踪(您可以在网络上传播跟踪 ID)。

Otherwise, without knowing what your programs are we can't help you only with environment variables.否则,在不知道您的程序是什么的情况下,我们只能通过环境变量来帮助您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM