英文:
Can we expose Apache Pulsar metrics through Micrometer?
问题
经纪人指标在端口8080下的"/metrics/"下公开。但是客户端指标(包括消费者和生产者)呢?我们能否通过Micrometer(特别是与Prometheus一起)公开Apache Pulsar的指标?
如果我们在Spring Boot中使用Pulsar会很有趣。我没有使用Spring for Apache Pulsar框架。客户端指标将包括:消耗批次所需的时间,失败次数等。
英文:
The broker metrics are exposed under "/metrics/" at port 8080. But, what about the client metrics (both consumer and producer)? Can we expose Apache Pulsar metrics through Micrometer (particularly with Prometheus)?
It would be interesting if we are using Pulsar with Spring Boot. I'm not using the Spring for Apache Pulsar framework. The client metrics would be like: how long it takes to consume a batch, how many failures, etc.
答案1
得分: 1
IMHO,Apache Pulsar
没有内置支持直接通过 Micrometer
或任何其他特定的指标系统公开客户端 metrics。
虽然 Pulsar
没有与 Micrometer
的本地集成,但您可以将您的 Pulsar 客户端代码仪表化以收集指标,然后使用 Micrometer
将这些指标导出到 Prometheus
。
使用 Pulsar 客户端 API
内置的机制来跟踪性能、故障等,例如,可以使用 timers
来测量批处理消耗的时间,使用 counters 来跟踪故障的数量。一旦您在您的 Pulsar 客户端代码
中收集了指标,您可以将它们推送到 Micrometer 的注册表
,Micrometer 将它们公开给 Prometheus
。
英文:
IMHO Apache Pulsar
does not have built-in support for exposing client metrics directly through Micrometer` or any other specific metrics system
Although Pulsar
does not have native integration with Micrometer
, you can instrument your Pulsar client code to collect metrics and then use Micrometer
to export those metrics to Prometheus
.
use the Pulsar client API's
built-in mechanisms for tracking performance, failures, etc. e.g. can use timers
to measure the time it takes to consume a batch and counters to track the number of failures. Once you have collected the metrics in your Pulsar client code
, you can push them to Micrometer's registry
, and Micrometer will expose them to Prometheus
.
答案2
得分: 0
以下是翻译好的部分:
FYI the Pulsar Go client exposes metrics out of the box (with a little code)
Here is a list of the metrics
https://github.com/apache/pulsar-client-go/blob/master/pulsar/internal/metrics.go
See here for integration options
https://pulsar.apache.org/docs/3.1.x/client-libraries-go-use/
英文:
FYI the Pulsar Go client exposes metrics out of the box (with a little code)
Here is a list of the metrics
https://github.com/apache/pulsar-client-go/blob/master/pulsar/internal/metrics.go
See here for integration options
https://pulsar.apache.org/docs/3.1.x/client-libraries-go-use/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论