ERROR: metricset jolokia.jmx: mbean properties must be in the form key=value

Hi,
I use metricbeat (jolokia) to get jmx information in Websphere.

jmx.mappings:

  • mbean: 'WebSphere:type=ThreadPool,name=WebContainer,*'
    attributes:
    • attr: maximumSize
      field: threadpool.maximumSize

The error is:
2020-01-20T17:00:57.768+0100 INFO module/wrapper.go:252 Error fetching data for metricset jolokia.jmx: mbean properties must be in the form key=value: WebSphere:type=ThreadPool,name=
WebContainer,*

But If you put this url:
jolokia-war-1.6.2/read/WebSphere:type=ThreadPool,name=WebContainer,*
the result is:
{"value":{"WebSphere:cell=Cell01,mbeanIdentifier=cells/Cell01/nodes/Node01/servers/server_01_01/server.xml#ThreadPool_1527689262778,name=WebContainer,node=Node01,platform=dynamicproxy,process=Fortuny_01_01,spec=1.0,type=ThreadPool,version=8.0.0.4":{"maximumSize":50,"name":"WebContainer","inactivityTimeout":60000,"growable":true,"minimumSize":50,"stats":{"statistics":[{"lowWaterMark":1,"highWaterMark":4,"unit":"N/A","current":2,"name":"ActiveCount","upperBound":0,"wSImpl":{"enabled":true,"highWaterMark":4,"unit":"N/A","mean":1.245895201393063,"statisticType":7,"name":"ActiveCount","integral":2.6420724E7,"lastSampleTime":1579519581782,"startTime":1579498375565,"lowWaterMark":1,"dataInfo":{"aggregatable":true,"participation":null,"unit":"N/A","level":7,"updateOnRequest":false,"dependency":null,"name":"ActiveCount","statisticSet":"basic","platform":"all","submoduleName":null,"type":5,"id":3,"description":"The number of concurrently active threads.","zosAggregatable":true,"category":"all","comment":"The number of concurrently active threads","resettable":true},"current":2,"id":3,"upperBound":0,"description":"The number of concurrently active threads.","lowerBound":0},"description":"The number of concurrently active threads.","lowerBound":0,"lastSampleTime":1579519581782,"startTime":1579498375565},{"lowWaterMark":1,"highWaterMark":50,"unit":"N/A","current":7,"name":"PoolSize","upperBound":50,"wSImpl":
.........

Hi @vmoragar and welcome to discuss :slight_smile:

Yeah, I am afraid that mbean definitions with wildcards in this form are not supported by Metricbeat.

Could you compare the results with this configuration?

jmx.mappings:
    mbean: 'WebSphere:type=ThreadPool,name=WebContainer,node=*'
    attributes:
        attr: maximumSize
        field: threadpool.maximumSize

I have created an issue in any case because it'd be nice to support wildcards on this format: https://github.com/elastic/beats/issues/15684

Thanks for reporting!

Hi @jsoriano,
I put this configuration
mbean: 'WebSphere:type=ThreadPool,name=WebContainer,node=*'

And error is:
":"javax.management.InstanceNotFoundException : No MBean with pattern WebSphere:cell=Cell01,name=WebContainer,node=*,type=ThreadPool

Detail:
2020-01-21T12:21:57.598+0100 DEBUG [jolokia.jmx] jmx/config.go:499 Jolokia response body {"host": "localhost:9081", "host": "localhost:9081", "uri": "h
ttp://localhost:9081/jolokia-war-1.6.2/%3FignoreErrors=true&canonicalNaming=false", "body": "[{"value":{"Uptime":20998229,"StartTime":1579584694202},"status":200,"timest
amp":1579605692,"request":{"type":"read","attribute":["Uptime","StartTime"],"mbean":"java.lang:type=Runtime"}},{"value":{"MaxHeapSize":4294967296,"HeapMemoryUsage":{"
init":4294967296,"max":4294967296,"committed":4294901760,"used":635674904},"NonHeapMemoryUsage":{"init":0,"max":-1,"committed":249902744,"used":160514408}},"status":200,"
timestamp":1579605692,"request":{"type":"read","attribute":["HeapMemoryUsage","NonHeapMemoryUsage","MaxHeapSize"],"mbean":"java.lang:type=Memory"}},{"value":{"ThreadCou
nt":100},"status":200,"timestamp":1579605692,"request":{"type":"read","attribute":"ThreadCount","mbean":"java.lang:type=Threading"}},{"error_type":"javax.management.Ins
tanceNotFoundException","status":404,"error":"javax.management.InstanceNotFoundException : No MBean with pattern WebSphere:cell=Cell01,name=WebContainer,node=,type=ThreadPool found fo
r reading attributes","stacktrace":"javax.management.InstanceNotFoundException: No MBean with pattern WebSphere:cell=Cell01,name=WebContainer,node=
,type=ThreadPool found for reading attributes

I find a work around:
I put

  • mbean: 'WebSphere:cell=Cell01,name=WebContainer,node=Node01,platform=dynamicproxy,process=server_01_01,spec=1.0,type=ThreadPool,version=8.0.0.4,mbeanIdentifier=*'
    with this configuration work fine.
    thanks for all

Good to see that you found a workaround, but I wonder if with this configuration you are finding all the mbeans that you expected.

In the example request you posted on the first comment there is an mbean with a property process=Fortuny_01_01. I guess this is not going to be collected if the configuration contains the fixed property process=server_01_01.

I wonder if this configuration with two wildcards would work for this case:

mbean: 'WebSphere:cell=Cell01,name=WebContainer,node=Node01,platform=dynamicproxy,process=*,spec=1.0,type=ThreadPool,version=8.0.0.4,mbeanIdentifier=*'

thanks,
I put

- mbean: 'WebSphere:cell=Cell01,name=WebContainer,node=Node01,platform=dynamicproxy,process=*,spec=1.0,type=ThreadPool,version=8.0.0.4,mbeanIdentifier=*' 

And work fine.

Hi Jaime,
I would like to transform in json value for read ActiveCount.current

jolokia.metrics.threadpool.webcontainer.stats.statistics {
"startTime": 1579671098013,
"unit": "N/A",
"wSImpl": {
"highWaterMark": 7,
"unit": "N/A",
"lowWaterMark": 1,
"lastSampleTime": 1579706417998,
"description": "The number of concurrently active threads.",
"enabled": true,
"mean": 1.639672808468067,
"id": 3,
"integral": 57913219,
"lowerBound": 0,
"current": 3,
"startTime": 1579671098013,
"upperBound": 0,
"statisticType": 7,
"dataInfo": {
"updateOnRequest": false,
"name": "ActiveCount",
"platform": "all",
"zosAggregatable": true,
"description": "The number of concurrently active threads.",
"statisticSet": "basic",
"category": "all",
"unit": "N/A",
"aggregatable": true,
"comment": "The number of concurrently active threads",
"id": 3,
"level": 7,
"type": 5,
"resettable": true
},
"name": "ActiveCount"
},
"lowWaterMark": 1,
"lowerBound": 0,
"description": "The number of concurrently active threads.",
"highWaterMark": 7,
"name": "ActiveCount",
"upperBound": 0,
"current": 3,
"lastSampleTime": 1579706417998
}
{
"lowWaterMark": 1,
"highWaterMark": 50,
"current": 8,
"name": "PoolSize",
"upperBound": 50,
"lastSampleTime": 1579699931684,
"wSImpl": {
"unit": "N/A",
"lowWaterMark": 1,
"current": 8,
"integral": 208810227,
"name": "PoolSize",
"id": 4,
"statisticType": 7,
"mean": 7.2418883811221955,
"lastSampleTime": 1579699931684,
"startTime": 1579671098013,
"dataInfo": {
"resettable": false,
"unit": "N/A",
"description": "The average number of threads in a pool.",
"zosAggregatable": true,
"aggregatable": true,
"level": 7,
"updateOnRequest": false,
"name": "PoolSize",
"id": 4,
"statisticSet": "basic",
"platform": "all",
"type": 5,
"category": "all",
"comment": "Average number of threads in Pool"
},
"upperBound": 50,
"enabled": true,
"description": "The average number of threads in a pool.",
"lowerBound": 50,
"highWaterMark": 50
},
"lowerBound": 50,
"startTime": 1579671098013,
"unit": "N/A",
"description": "The average number of threads in a pool."
}

Thanks for all.
Regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.