如何使用Spring Boot 2将Kafka指标公开到/actuator/metrics [英] How to expose kafka metrics to /actuator/metrics with spring boot 2

查看:794
本文介绍了如何使用Spring Boot 2将Kafka指标公开到/actuator/metrics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了一会儿,似乎没有找到答案. 我正在使用Spring Boot 2,Spring Kafka 2.1.4,并且我想在Spring Boot执行器的/metrics端点中查看kafka使用者指标. 我不明白的是-我应该自己实施曝光还是在启动2中直接使用该曝光?

I was looking a while and didn't seem to find the answer. I'm using Spring boot 2, Spring Kafka 2.1.4 and I want to see the kafka consumer metrics in the /metrics endpoint of spring boot actuator. What I don't understand is - should I implenemt the exposure myself or is this comes out-of-box in boot 2 ?

如果我实现自己的自我,最好的方法是什么?

If I to implement this my self, what is the best way to do it?

推荐答案

针对千分尺v1.1.0的目标是MeterBinderKafkaConsumerMetrics实现.这应该可以显示您正在寻找的kafka消费者指标.

Targeted for micrometer v1.1.0 is the KafkaConsumerMetrics implementation of MeterBinder. This should expose the kafka consumer metrics you're looking for.

来源参考:

https://github.com/micrometer-metrics/micrometer/blob/master/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/kafka/KafkaConsumerMetrics .java

这篇关于如何使用Spring Boot 2将Kafka指标公开到/actuator/metrics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆