JMX input filter, howto construct right query


(Steffen Winther Sørensen) #1

So I've got a jconsole on a cassandra 2.0 cluster and can see metrics like o.a.c.m.ThreadPools.request.RequestResponseStage.*Tasks

cassandra wiki says (note ThreadPool in singular):

o.a.c.m:type=ThreadPool,path=(type),scope=(Thread pool name),name=(Metric name)
where:
(path) is either internal or request, based on the usage of thread pool
(scope) is (path).(Thread pool name)
(name) is one of the five Tasks, ie. ActiveTasks...

But how should I read this to configure my jmx input query's json to fetch such metric, below doesn't work:

{
"object_name" : "org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=RequestResponseStage,name=*",
"attributes" : [ "ActiveTasks", "CompletedTasks", "CurrentlyBlockedTasks", "PendingTasks", "TotalBlockedTasks" ],
"object_alias" : "${type}.${path}.${scope}.${name}"
}

It returns this warning:

undefined method `active_tasks' for #JMX::MBean:0x553f7ee2 {:level=>:warn}
Failed retrieving metrics for attribute ActiveTasks on object org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=RequestResponseStage,name=ActiveTasks {:level=>:warn}

Though one would believe this to be correct when looking at the jconsole

Other metric fetches fine, and return events as expected like:

{
"@version" => "1",
"@timestamp" => "2015-12-10T23:19:20.791Z",
"host" => "d1r1n1",
"type" => "jmx",
"metric_path" => "blob.BufferPool.direct.ObjectName",
"metric_value_string" => "java.nio:type=BufferPool,name=direct",
"@metadata" => {
"esindex" => "cass",
"output-stdout" => "true"
}
}

Hints much appreciated, TIA!


(Steffen Winther Sørensen) #2

Connected a Console and browsed the MBeans and found that this works:

{
"object_name" : "org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=RequestResponseStage,name=*",
"object_alias" : "${type}.${path}.${scope}.${name}"
}


(system) #3