我使用Kafka2.11-0.9.0.1,我尝试了两个版本的jason配置文件。我可以在这里获得像heapmem和gc这样的jvm信息
但当我想得到Kafka的指标时,什么都没有。这是jmxtrans日志。在此处输入图像描述
还有,这是jason file i用户的两个版本:
{
"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"
]
}
1条答案
按热度按时间koaltpgm1#
这是版本问题。我建议jconsole查看mbeans树。这很有帮助。