简体   繁体   English

每单位时间在kafka主题中收到的新消息数

[英]Number of new messages received in a kafka topic per unit time

I am trying to chart number of new messages received per unit time (minute or hour) in a given Kafka topic. 我试图在给定的Kafka主题中绘制每单位时间(分钟或小时)收到的新消息数。

I have seen posts around finding the number of current messages in a topic. 我已经看到有关查找某个主题中当前消息数的帖子。 As a potential solution I could query this number at each time interval, however, this doesn't account for expired messages (due to retention time). 作为一种可能的解决方案,我可以在每个时间间隔查询此数字,但是,这并不考虑过期的消息(由于保留时间)。

Is there a way to get the number of new messages received in a kafka topic per unit time? 有没有办法获取每单位时间在kafka主题中收到的新消息的数量?

In JMX metrics you can find kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec which indicates the incoming message rate. 在JMX指标中,您可以找到kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec ,它指示传入的消息速率。 you can store it in Prometheus or another time series database and query it based on time. 您可以将其存储在Prometheus或其他时间序列数据库中,并根据时间进行查询。

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

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