大网数据广告活动
服务器运维问答

Wrong measurements being reported by JMX and collectd for Apache Kafka

· 52CE 我爱测

I'm using JMX to gather metrics from Apache Kafka and send to Librato, a visualization and monitoring service, via collectd. The problem is that some metrics seems to be reporting wrongly. For instance, without anyone using the K…

问题原文

原帖链接 · Matheus Portela · CC BY-SA 3.0

I'm using JMX to gather metrics from Apache Kafka and send to Librato, a visualization and monitoring service, via collectd. The problem is that some metrics seems to be reporting wrongly. For instance, without anyone using the Kafka cluster, some nodes report high number of incoming messages for minute (like 15,000), whereas the others report 0, as expected.

Here is one of the metrics configuration in collectd:

<MBean "kafka-all-messages">
  ObjectName "kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec"
  InstancePrefix "all"
  <Value>
    InstancePrefix "kafka-messages-in"
    Type "counter"
    Table false
    Attribute "MeanRate"
  </Value>
</MBean>

And here is the graph in Librato:

Does anyone know what's going wrong? Is it my collectd configuration, such as Type or anything like this?

已采纳解答

原帖链接 · Matheus Portela · CC BY-SA 3.0

Just a small follow up on this issue: it wasn't neither JMX nor collectd mistakes. I verified JMX, collectd and Librato were with consistent values by logging in directly to each Kafka broker and reading the values in their MBeans.

The problem was we were using Kafka clients with too small auto-commit interval, which generated huge numbers of messages being sent to each Kafka broker.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。