JMX probes

The JMX probe can collect metrics from JMX beans inside and outside Magnolia. The JMX probes are configured in the instrumentation module.

You can configure multiple JMX probes to collect metrics from different JMX beans. A configured JMX probes can collect several metrics from a single MX bean.

A MX bean can provide many different properties and values. A JMX probe uses one or more JMX attribute metrics to collect metrics (info.magnolia.services.instrumentation.probes.jmx.JMXAttributeMetric) from a MX bean.

So, to summarize:

  • JMX probe: retrieves a MX bean with a JMX query, passes the MX bean to its JMX attribute metrics to collect metrics

  • JMX attribute metric: defines and collects a metric from a property of the MX bean

JMX attribute metrics can handle two types of values returned by MX bean properties: single values and maps.

Metrics collected by a JMX attribute metric have a double value. If the property of the MX bean is not convertible to a double value, you can set a default value in the JMX attribute collector to be used as the value of the metric.

If the MX bean property returns a map, the mapped JMX attribute metric () can select a value from the map and use it as the value of the metric.The mapped JMX attribute metric specifies a map key retrieve the metric value from the property map.

JMXProbe

The JMXProbe can collect one or more metrics from a JMX bean.

Note that the JMX attribute metrics actually define and collect metrics from the JMX bean, the JMX probe itself just retrieves the JMX bean.

Configuration properties

Property Description Required

class

info.magnolia.services.instrumentation.probes.jmx.JMXProbe

name

The probe name.

The probe name will not be used as the metric name; the metric name(s) are defined by the JMX attribute metric(s).

description

A description of the probe.

enabled

Flag controlling if the probe is active and can provide measurements (true) or is disabled and not providing measurements (false).

Default = true

objectName

A JMX query for a JMX bean.

metrics

A list of one or more JMX attribute metrics, either JMX attribute metrics (info.magnolia.services.instrumentation.probes.jmx.JMXAttributeMetric) or mapped JMX attribute metrics (info.magnolia.services.instrumentation.probes.jmx.MappedJMXAttributeMetric).

The metrics provided by the JMX probe depend on the JMX attribute metrics defined for the probe.

JMXAttributeMetric

A JMXAttributeMetric defines a metric with value from a JMX bean property. The property value should be a single value.

If the JMX bean property is not convertible to a double value, a default value can be used as the value for the metric.

Configuration properties

Property Description Required

class

info.magnolia.services.instrumentation.probes.jmx.JMXAttributeMetric

name

The JMX bean property name to be retrieved.

The value of the bean property will be used as the metric value.

metricName

The name of the metric.

metricDescription

A description of the metric.

convertible

A flag indicating if the MX bean property value can be converted to a double and used as the metric value.

  • If true, and the property value is not numeric, the property value is converted to a double and used as the metric value.

  • If false, the the property value is not numeric, the default value is used as the metric value.

Default = true

defaulValue

The default value for the metric used when the bean property value is not numeric and convertible is set to false.

Default = 1.0

Metrics

Metric Description

<metric-name>

The configured metric name.

MappedJMXAttributeMetric

A MappedJMXAttributeMetric defines a metric with value from a JMX bean property that returns a map.

If the value retrieved from the map is not convertible to a double value, a default value can be used as the value for the metric.

Configuration properties

Property Description Required

class

info.magnolia.services.instrumentation.probes.jmx.MappedJMXAttributeMetric

name

The JMX bean property name to be retrieved.

The value of the bean property will be used as the metric value.

metricName

The name of the metric.

metricDescription

A description of the metric.

convertible

A flag indicating if the MX bean property value can be converted to a double and used as the metric value.

  • If true, and the property value is not numeric, the property value is converted to a double and used as the metric value.

  • If false, the the property value is not numeric, the default value is used as the metric value.

Default = true

defaulValue

The default value for the metric used when the bean property value is not numeric and convertible is set to false.

Default = 1.0

Metrics

Metric Description

<metric-name>

The configured metric name.

Example

MappedJMXAttributeMetric sample config
Feedback

Incubators

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Instrumentation module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules