如何找到Kafka消息的处理时间? [英] How to find the processing time of Kafka messages?

查看:85
本文介绍了如何找到Kafka消息的处理时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行 Kafka 消费者的应用程序,我想监控从该主题消费的每条消息的处理时间.该应用程序是一个 Spring 启动应用程序,并使用微米注册表将 Kafka 消费者指标公开给 Spring Actuator Prometheus 端点.我可以使用 kafka_consumer_commit_latency_avg_seconds 或 kafka_consumer_commit_latency_max_seconds 来监控或提醒吗?

解决方案

这些指标与记录处理时间无关.spring-kafka 为此提供了指标;请参阅此处.

<块引用>

监控听众表现

<块引用>

从版本 2.3 开始,如果在类路径上检测到 Micrometer,并且应用程序上下文中存在单个 MeterRegistry,则侦听器容器将自动为侦听器创建和更新 Micrometer Timer .可以通过将 ContainerProperty micrometerEnabled 设置为 false 来禁用计时器.

维护两个计时器 - 一个用于成功调用侦听器,另一个用于 >失败.

I have an application running Kafka consumers and want to monitor the processing time of each message consumed from the topic. The application is a Spring boot application and exposes Kafka consumer metrics to Spring Actuator Prometheus endpoint using micrometre registry. Can I use kafka_consumer_commit_latency_avg_seconds or kafka_consumer_commit_latency_max_seconds to monitor or alert?

解决方案

Those metrics have nothing to do with record processing time. spring-kafka provides metrics for that; see here.

Monitoring Listener Performance

Starting with version 2.3, the listener container will automatically create and update Micrometer Timer s for the listener, if Micrometer is detected on the class path, and a single MeterRegistry is present in the application context. The timers can be disabled by setting the ContainerProperty micrometerEnabled to false.

Two timers are maintained - one for successful calls to the listener and one for >failures.

这篇关于如何找到Kafka消息的处理时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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