【问题标题】:why I get nothing about kafka metrics with jmxtrans since I can get JVM heap info?为什么我对 jmxtrans 的 kafka 指标一无所知,因为我可以获得 JVM 堆信息?
【发布时间】:2016-07-24 06:12:36
【问题描述】:

我使用 kafka_2.11-0.9.0.1,我尝试了两个版本的 jason 配置文件。我可以获得像 heapmem 和 GC 这样的 JVM 信息 enter image description here

但是当我想获得 kafka 指标时,什么都没有。这是 jmxtrans 日志。 enter image description here

还有,这是我使用的两个版本的 jason 文件:

   {
  "servers" : [ {
   "port" : "9999",
   "host" : "localhost",
   "queries" : [ {
    "outputWriters" : [ {
    "@class" : "com.googlecode.jmxtrans.model.output.StdOutWriter",
    "settings" : {
    }
  } ],
  "obj" : "kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec,topic=test",
  "attr" : [ "Count"]
},{

    "outputWriters" : [ {
    "@class" : "com.googlecode.jmxtrans.model.output.StdOutWriter",
    "settings" : {
    }
  } ],
  "obj" : "kafka.server:type=BrokerTopicMetrics,name=*",
      "resultAlias": "Kafka",
  "attr" : [ "Count","OneMinuteRate"]
}



 ],
"numQueryThreads" : 2

}] }

另一个是:

{
      "outputWriters" : [ {
    "@class" : "com.googlecode.jmxtrans.model.output.KeyOutWriter",
    "settings" : {
            "outputFile" : "testowo-counts3.txt",
      "maxLogFileSize" : "10MB",
      "maxLogBackupFiles" : 200,
      "delimiter" : "\t",
      "debug" : true

    }
  } ],

            "obj": "\"kafka.network\":type=\"RequestMetrics\",name=\"Produce-RequestsPerSec\"",
            "resultAlias": "produce",
            "attr": [
                "Count",
                "OneMinuteRate"
            ]

    } ,{
    "outputWriters" : [ {
    "@class" : "com.googlecode.jmxtrans.model.output.KeyOutWriter",
    "settings" : {
            "outputFile" : "testowo-gc.txt",
      "maxLogFileSize" : "10MB",
      "maxLogBackupFiles" : 200,
      "delimiter" : "\t",
      "debug" : true

    }
  } ],

  "obj": "java.lang:type=GarbageCollector,name=*",
            "resultAlias": "GC",
            "attr": [
                "CollectionCount",
                "CollectionTime"
            ]
    }

【问题讨论】:

    标签: java jvm apache-kafka jmx jmxtrans


    【解决方案1】:

    这是版本问题。我推荐 jconsole 来查看 Mbeans 树。很有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-24
      • 2012-01-27
      • 1970-01-01
      • 2015-09-30
      • 1970-01-01
      • 1970-01-01
      • 2011-07-11
      • 2013-03-20
      相关资源
      最近更新 更多