Metricbeat Jolokia Module Not Publishing Custom MBean Data

Hello,

I have been trying to get a field from a custom bean published to Kibana but it seems like jolokia is ignoring the jmx mapping for the custom bean field.

Here is my metricbeat.yml:

    metricbeat.modules:
      - module: jolokia
    metricsets: ["jmx"]
    enabled: true
    period: 10s
    hosts: ["https://localhost:8993"]
    path: "/admin/jolokia"
    ssl.verification_mode: none
    namespace: "testnamespace"
    http_method: "GET" 
    jmx.mappings:
      - mbean: 'App Status:service=Health'
        attributes:
          - attr: CurrentStatus
            field: health
      - mbean: 'java.lang:type=Runtime'
        attributes:
          - attr: Uptime
            field: uptime

The field jolokia.testnamespace.uptime is visible with the correct data in kibana. Although jolokia.testnamespace.health field does not exist in kibana. Metricbeat debug logs do not report any error.

    metricbeat               | 2020-06-23T20:07:47.133Z	DEBUG	[jolokia.jmx]	jmx/config.go:366	Jolokia response body	{"host": "localhost:8993", "host": "localhost:8993", "uri": "https://localhost:8993/admin/jolokia/read/java.lang:type=Runtime/Uptime?ignoreErrors=true&canonicalNaming=false", "body": "{\"request\":{\"mbean\":\"java.lang:type=Runtime\",\"attribute\":\"Uptime\",\"type\":\"read\"},\"value\":5808306,\"timestamp\":1592942867,\"status\":200}", "type": "response"}

    metricbeat               | 2020-06-23T20:09:54.652Z	DEBUG	[jolokia.jmx]	jmx/config.go:366	Jolokia response body	{"host": "localhost:8993", "host": "localhost:8993", "uri": "https://localhost:8993/admin/jolokia/read/App Status:service=Health/CurrentStatus?ignoreErrors=true&canonicalNaming=false", "body": "{\"request\":{\"mbean\":\"App Status:service=Health\",\"attribute\":\"CurrentStatus\",\"type\":\"read\"},\"value\":\"Good\",\"timestamp\":1592942994,\"status\":200}", "type": "response"}

Although, the publish only publishes uptime field and not health as stated before.

    "@timestamp": "2020-06-23T20:09:57.949Z",
      "@metadata": {
        "beat": "metricbeat",
        "type": "_doc",
        "version": "7.5.1"
      },
      "agent": {
        "ephemeral_id": "f373d7d4-...",
        "hostname": "9962...",
        "id": "cbab3a1e-...",
        "version": "7.5.1",
        "type": "metricbeat"
      },
      "event": {
        "module": "jolokia",
        "duration": 10799099116,
        "dataset": "jolokia.testnamespace"
      },
      "metricset": {
        "period": 10000,
        "name": "jmx"
      },
      "jolokia": {
        "testnamespace": {
          "uptime": 5.949921e+06
        }
      },
      "service": {
        "address": "localhost:8993",
        "type": "jolokia"
      },
      "ecs": {
        "version": "1.1.0"
      },
      "host": {
        "name": "99624a..."
      }
    }

Any help is appreciate.
Thanks!

Could you dump here what do you see if you hit the URL https://localhost:8993/admin/jolokia/read/App Status:service=Health/CurrentStatus?ignoreErrors=true&canonicalNaming=false ?

Sure thing!

Here it is:

{
    "request": {
       "mbean": "App Status:service=Health",
       "attribute": "CurrentStatus",
       "type": "read"
    },
    "value": "Good",
    "timestamp": 1593017229,
    "status": 200
}

I think you can create an issue for this in Beats. The configuration doesn't look bad, I wonder if the metricbeat swallows an error somewhere.

1 Like

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