1

我想监控 solr,并有 jmxtrans 配置:

{
   "servers":[
      {
         "port":"8099",
         "host":"localhost",
         "queries":[
            {
               "obj":"solr/*:type=/select,id=org.apache.solr.handler.component.SearchHandler",
               "resultAlias":"solr",
               "attr":[
                    "requests","errors","avgRequestsPerSecond","avgTimePerRequest","95thPcRequestTime"
               ],

               "outputWriters":[
                  {
                     "@class":"com.googlecode.jmxtrans.model.output.KeyOutWriter",
                     "settings":{
                        "outputFile" : "/tmp/jmx.log",
                        "maxLogFileSize" : "10MB",
                        "maxLogBackupFiles" : 2,
                        "debug" : true
                     }
                  }
               ]
            }
         ]
      }
   ]
}

我已配置通配符域名

"obj":"solr/*:type=/select,id=org.apache.solr.handler.component.SearchHandler"

但我得到以下没有域名的结果:

localhost_8099.solr.errors 0   1446715240625
localhost_8099.solr.avgRequestsPerSecond   0.00883917964270778 1446715240625
localhost_8099.solr.avgTimePerRequest  1.99831994970047    1446715240625
localhost_8099.solr.95thPcRequestTime  3.8249146499999997  1446715240625
localhost_8099.solr.requests   717419  1446715241205
localhost_8099.solr.errors 0   1446715241205

我试过 typeNames:https ://code.google.com/p/jmxtrans/wiki/Queries 但它似乎不支持域。

4

1 回答 1

1

我找到了答案,添加以下配置:

...
    "obj":"solr/*:type=/select,id=org.apache.solr.handler.component.SearchHandler",
    "useObjDomainAsKey":true,
...
于 2015-11-05T09:43:53.770 回答