Hi:
I configured jolokia to get metrics on a Tomcat 7 ThreadPool.
The configuration included the wildcard (*) to avoid to specify the pool name (which changes from Tomcat 7 to Tomcat 8) this way:
-
module: jolokia
metricsets: ["jmx"]
period: 10s
hosts: ["localhost:8080"]
namespace: "metrics"
path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
jmx.mapping:
jmx.application:
jmx.instance:jmx.mappings:
- mbean: 'Catalina:name=*,type=ThreadPool'
attributes:- attr: maxConnections
field: max_connections - attr: currentThreadsBusy
field: current_threads_busy - attr: maxThreads
field: max_threads - attr: currentThreadCount
field: current_thread_count - attr: connectionCount
field: connection_count
- attr: maxConnections
- mbean: 'Catalina:name=*,type=ThreadPool'
jolokia webapp actually returns all the ThreadPool instances (in my case only one named "http-bio-8080") however metricbeat does not send the metrics to Logstash but rather a field with:
error.message: "1 error: metric key '' not found in response"
As suggested in a github issue, I changed the wildcard for the ACTUAL name returned by jolokia and it worked fine.
However I just wanted to know if can be improved such behavior to allow the wildcard to work when only one mbean is found (many results returned would seem like you need to refine the actual metric to get).
Thanks in advance,
Gabriel