简体   繁体   English

生产者/消费者 JMX 指标

[英]Producer/consumer JMX metrics

I am stuck in a dump problem.我陷入了转储问题。 It seems at least like this...至少看起来是这样的……

I am trying to generate JMX metrics from kafka console producer right now.我现在正在尝试从 kafka 控制台生产者生成 JMX 指标。 I am done with broker.我完成了经纪人。

I have a collectd conf file我有一个 collectd conf 文件

LoadPlugin java
<Plugin java>
    <Plugin "GenericJMX">
        <MBean "kafka.producer.request-rate">
            ObjectName "kafka.producer:type=producer-metrics,clientId=([-.\w]+)"
            InstancePrefix "all"
            <Value>
                InstancePrefix "kafka-producer-request-rate"
                Type "gauge"
                Table false
                Attribute "request-rate"
            </Value>
        </MBean>
        <Connection>
            ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi"
            Host "tgarg"
            Collect "classes"
            Collect "garbage_collector"
            Collect "memory-heap"
            Collect "memory-nonheap"
            Collect "memory_pool"
            Collect "kafka.producer.request-rate"
        </Connection>
    </Plugin>
</Plugin>

This looks good to me but on collectd end I am getting这对我来说看起来不错,但在收集端我得到了

collectd[552]: GenericJMXConfMBean: No MBean matched the ObjectName kafka.producer:type=producer-metrics,clientId=([-.w]+)

Any help is appreciated.任何帮助表示赞赏。
Thanks-Tarun谢谢-塔伦

Do you see jmx enabled when you run jps -v ?运行jps -v时是否看到启用了 jmx?

-Dcom.sun.management.jmxremote.port=9999 should be visible in your case. -Dcom.sun.management.jmxremote.port=9999在您的情况下应该是可见的。

More information on how to configure jmx : http://docs.confluent.io/current/cp-docker-images/docs/operations/monitoring.html有关如何配置 jmx 的更多信息: http : //docs.confluent.io/current/cp-docker-images/docs/operations/monitoring.html

You have to enable JMX setting JMX_PORT environment variable before calling kafka_console_producer.sh.在调用 kafka_console_producer.sh 之前,您必须启用 JMX 设置 JMX_PORT 环境变量。 Something like this:像这样的东西:

JMX_PORT=9999 ./kafka-console-producer.sh --broker-list 127.0.0.1:9092 --topic topic1

See bin/kafka-run-class.sh script for details.有关详细信息,请参阅 bin/kafka-run-class.sh 脚本。

As i said this is dump problem.正如我所说,这是转储问题。 collectD doesn't understand ([-.\\w]+), i replaced this with * and clientId with client-id (my bad). collectD 不明白 ([-.\\w]+),我用 * 替换了它,用 client-id 替换了 clientId(我的错)。

Thanks all谢谢大家

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

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