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

What do MBean parameters mean in collectd?

· 52CE 我爱测

I'm using JMX to monitor an Apache Kafka cluster with collectd's GenericJMX plugin. However, I'm not sure what some of the MBean parameters mean. Particularly, I have one metric called kafka.server:type=BrokerTopicMetrics,name=Me…

问题原文

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

I'm using JMX to monitor an Apache Kafka cluster with collectd's GenericJMX plugin. However, I'm not sure what some of the MBean parameters mean.

Particularly, I have one metric called kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec, showing the number of messages per second received by one machine. This is my configuration file for this MBean:

<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>

I don't know which Type is the correct one for this measurement, such as gauge, counter or another one. I've tried reading this documentation on collectd by couldn't really understand where I should apply each measurement type.

Could someone explain me it?

已采纳解答

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

I finally manage to get it working. Pretty much all Kafka metrics in JMX have multiple attributes. For instance, this kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec contains the following attributes:

  • Count
  • EventType
  • FifteenMinuteRate
  • FiveMinuteRate
  • MeanRate
  • OneMinuteRate
  • RateUnit

When selecting the Type, you must choose whether you want it to retrieve the value as is or its difference for the interval collectd is configured to report metrics. Hence, gauge is the value and counter is the difference.

The most flexible way to report Kafka's JMX metrics is to simply use the Count attribute, a monotonically increasing counter that is incremented whenever a new message arrives, and report it as a counter. If collectd is configured to report every 60 seconds, this will be the number of messages coming in per minute. If it is reporting every 10 minutes, the value will be the number of messages per 10 minutes.

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

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

资料来源与适用范围

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

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

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