JMX extensions
JMX (Java Management Extensions) is ideal for monitoring applications built using Java. With Dynatrace, you can monitor any metric in your JVM that is exposed via an MBean.
Infrastructure Monitoring mode
JMX and PMI extensions are also available in Infrastructure Monitoring mode You can use them to monitor any infrastructure component and backing service written in Java and have all the collected metrics reported by Dynatrace.
Create a JMX extension
Viewing JMX metrics in Dynatrace
JMX metrics are available for all Java-based processes monitored by OneAgent.
Once your extension is uploaded, Dynatrace automatically begins querying the defined metrics for all Java processes. To find the metrics, go to a relevant process page and click Further details.
For example, for a extension named HornetQ
, go to the process you selected when creating the extension, click Further details and then select the HornetQ tab named automatically after the extension name. You'll find all the defined metrics there.
JMX monitoring is highly dynamic. If a particular metric doesn’t exist in your JVM, it's not an error—the metric simply isn't available.
JMX/PMI extension custom metrics
You may notice that the number of metrics in the plugin.json
file of your JMX/PMI extension differs from the number of billed custom metrics. This is because JMX/PMI extensions provide "splittings" which can be used to define additional dimensions for reported metrics. For each value of a selected property, a separate timeseries metric is created at runtime. The actual number of timeseries metrics depends on the number of distinct values for the selected property.
The following sample shows how to define a metric that provides multiple timeseries with a single metric:
1"metrics": [2 {3 "timeseries": {4 "key": "XY.Size",5 "unit": "Count",6 "displayname": "Queue Consumer Count",7 "dimensions": [8 "rx_pid",9 "name"10 ]11 }12 "source": {13 "domain": "com.sample",14 "keyProperties": {15 "type": "XY",16 "name": "*"17 },18 "attribute": "Size",19 "splitting": {20 "name": "name",21 "type": "keyProperty",22 "keyProperty": "name"23 }24 }25 }26]
In this example, MBeans com.sample:type=XY,name=A
and com.sample:type=XY,name=B
will result in two timeseries metrics (A
and B
).
Since such values typically aren't known in advance, and are subject to change, this can lead to an unexpectedly high number of consumed custom metrics. If the values of the property are known in advance, or if only some of the values are of interest, we recommend that you specify one metric for each value and not use splitting.
Metrics limit per JMX extension
There can be no more than 5,000
metrics per JMX extension. This limit is necessary to prevent underperforming or metric-heavy extensions from overwhelming the monitoring system.