简体   繁体   English

我们应该使用什么gRPC监控和grpc-java指标?

[英]What gRPC monitoring and metrics for grpc-java should we be using?

We use many grpc channels in a production environment. 我们在生产环境中使用许多grpc通道。 Some of the channels are opened then shutdown, and many are left open persistently. 一些通道打开然后关闭,许多通道保持打开状态。

Recently after a development project, we realized we were leaving some channels open instead of shutting them down, and we didn't realize it until it became a real hassle to fix. 最近在一个开发项目之后,我们意识到我们正在打开一些渠道而不是关闭它们,直到它成为一个真正的麻烦来解决之前我们才意识到这一点。

We would like to get some monitoring in place for the connections. 我们希望对连接进行一些监控。

I have found https://github.com/grpc/grpc-java/blob/master/documentation/monitoring-service-tutorial.md but it says 我找到了https://github.com/grpc/grpc-java/blob/master/documentation/monitoring-service-tutorial.md,但它说

Note: The monitoring service requires the instrumentation-java library implementations, which are still being developed. 注意:监视服务需要instrumentation-java库实现,这些实现仍在开发中。 The steps in this tutorial will not work until the instrumentation-java implementation is released. 在发布instrumentation-java实现之前,本教程中的步骤不起作用。

I am looking for some simple monitoring for our grpc. 我正在为我们的grpc寻找一些简单的监控。 Such as channels open, throughput, error counts the basic stuff. 如渠道开放,吞吐量,错误计算基本的东西。

Just wondering what your teams are using for monitoring grpc java in production? 只是想知道你的团队在生产中监控grpc java的用途是什么?

You can get metrics using interceptors. 您可以使用拦截器获取指标。

java-grpc-prometheus provides server and client side metrics (channels, message by method, etc) java-grpc-prometheus提供服务器和客户端指标(通道,方法消息等)

Besides that, you can instrument your code with Opentracing spans to make easier to follow and measure whole transactions. 除此之外,您还可以使用Opentracing跨度来检测代码,以便更轻松地跟踪和测量整个事务。

I've a GitHub project that monitors the following for each RPC call: 我有一个GitHub项目,监视每个RPC调用的以下内容:

  1. Service name (as in proto file) 服务名称(在原型文件中)
  2. Method name (as in proto file) 方法名称(在proto文件中)
  3. Timing (latency) 时间(延迟)
  4. Status 状态
  5. Site (CLIENT/SERVER) 站点(CLIENT / SERVER)

It also monitors the server and client side thread pool information. 它还监视服务器和客户端线程池信息。

https://github.com/asarkar/kotlin/tree/master/grpc-learning https://github.com/asarkar/kotlin/tree/master/grpc-learning

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

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