Jolokia jmx metricsetedit

Warning

This functionality is in beta and is subject to change. The design and code is considered to be less mature than official GA features. Elastic will take a best effort approach to fix any issues, but beta features are not subject to the support SLA of official GA features.

This is the jmx metricset of the Jolokia module.

Features and configurationedit

Tested with Jolokia 1.3.4.

Metrics to be collected from each Jolokia instance are defined in the mapping section with an MBean ObjectName and an array of Attributes to be requested with Elastic field names under which the return values should be saved.

For example: to get the "Uptime" attribute from the "java.lang:type=Runtime" MBean and map it to something like "uptime" (actually "jolokia.jmx.uptime", the prexif is added by beats framework) you have to configure following mapping:

---
- module: jolokia
  metricsets: ["jmx"]
  hosts: ["localhost:8778"]
  namespace: "metrics"
  jmx.mappings:
    - mbean: 'java.lang:type=Runtime'
      attributes:
        - attr: Uptime
          field: uptime
---

In case the underlying attribute is an object (e.g. see HeapMemoryUsage attribute in java.lang:type=Memory) its structure will be published to Elastic "as is".

It is possible to configure nested metric aliases by using dots in the mapping name (e.g. gc.cms_collection_time). For examples please refer to the /jolokia/jmx/test/config.yml.

All metrics from a single mapping will be POSTed to the defined host/port and sent to Elastic as a single event. To make it possible to differentiate between metrics from multiple similar applications running on the same host, please configure multiple modules.

It is required to set a namespace in the general module config section.

Limitationsedit

No authentication against Jolokia is supported yet. No wildcards in Jolokia requests supported yet. All Jolokia requests have canonicalNaming set to false (details see here: https://jolokia.org/reference/html/protocol.html).

Exposed fields, dashboards, indexes, etc.edit

Since this is a very general module that can be tailored for any application that exposes its metrics over Jolokia, it comes with no exposed fields description, dashboards or index patterns.

Fieldsedit

For a description of each field in the metricset, see the exported fields section.

Here is an example document generated by this metricset:

{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "beat": {
        "hostname": "host.example.com",
        "name": "host.example.com"
    },
    "jolokia": {
        "testnamespace": {
            "memory": {
                "heap_usage": {
                    "committed": 112721920,
                    "init": 64673792,
                    "max": 921174016,
                    "used": 81023984
                },
                "non_heap_usage": {
                    "committed": 24576000,
                    "init": 24576000,
                    "max": 224395264,
                    "used": 17684240
                }
            },
            "uptime": 580487
        }
    },
    "metricset": {
        "host": "jolokia:8778",
        "module": "jolokia",
        "name": "jmx",
        "namespace": "testnamespace",
        "rtt": 115
    }
}