如何使用Prometheus监控grpc-java server和client?
How to use Prometheus to monitor grpc-java server and client?
我想使用 Prometheus 监控我的 grpc 服务器和 grpc 客户端?但我不知道如何监听 GRPC 服务器的端口?
Prometheus 不支持 grpc 作为抓取协议,因此您需要打开单独的 http 端口或使用某种 prometheus 推送网关。 https://github.com/coreos/prometheus-operator/issues/1969
如果您正在使用 spring-boot,您可以使用 https://github.com/yidongnan/grpc-spring-boot-starter 如果 spring-boot-actuator 出现在您的 cp 上,它将自动配置指标。
<dependency>
<groupId>net.devh</groupId>
<artifactId>grpc-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
披露:我是 grpc-spring-boot-starter 的核心开发人员之一。
我想使用 Prometheus 监控我的 grpc 服务器和 grpc 客户端?但我不知道如何监听 GRPC 服务器的端口?
Prometheus 不支持 grpc 作为抓取协议,因此您需要打开单独的 http 端口或使用某种 prometheus 推送网关。 https://github.com/coreos/prometheus-operator/issues/1969
如果您正在使用 spring-boot,您可以使用 https://github.com/yidongnan/grpc-spring-boot-starter 如果 spring-boot-actuator 出现在您的 cp 上,它将自动配置指标。
<dependency>
<groupId>net.devh</groupId>
<artifactId>grpc-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
披露:我是 grpc-spring-boot-starter 的核心开发人员之一。