• Home
  • Deploy Dynatrace
  • Dynatrace OneAgent
  • Installation and operation
  • Dynatrace for z/OS
  • z/OS monitoring overview
  • Monitor JMX metrics on z/OS

Monitor JMX metrics on z/OS

z/OS Java code module version 1.247+ zRemote module version 1.247+

JMX (Java Management Extensions) is handy for monitoring applications built using Java. With the OneAgent z/OS Java code module, you can monitor any metric in your JVM that is exposed via an MBean.

Notes
  • Every monitored custom JMX metric consumes Davis data units. The concept of Included metrics per host unit isn't applicable for monitored LPARs on z/OS. To learn more about Davis data units, see DDUs for metrics.
  • PMI (Performance Monitoring Infrastructure) for the IBM WebSphere Application Server is currently not supported.

Definition

The customJmxMetrics attribute defines a list of metrics to be monitored. To get started, add the customJmxMetrics attribute to your dtconfig.json file as shown in the following example.

Typically, you've created the dtconfig.json file during the z/OS Java code module installation and have set the attributes Tenant, ClusterID, and zdcName to your environment.

json
{ "Tenant": "mytenant", "ClusterID": 12345678, "ZdcName": "DEFAULT", "customJmxMetrics": [ { "name": "java.lang.CurrentThreadCount", "source": { "domain": "java.lang", "keyProperties": { "type": "Threading", }, "attribute": "ThreadCount" } } ] }

Metrics

Each metric has the following mandatory attributes:

FieldTypeDescription
nameStringSets the name of the metric in Dynatrace. It must start with a letter. Only alphanumeric characters or . are allowed.
sourceObjectSpecifies how the metric is collected. For details, see the Source section below.

Source

The source specifies how a metric is collected using JMX. Each source has the following mandatory attributes:

FieldTypeDescription
domainStringDomain name of the MBean. It can contain wildcards (*).
keyPropertiesKey, Value pairsKey properties of the MBean. Values can contain wildcards (*).
attributeStringName of the attribute that contains the metric value.

Optional source attributes are:

FieldTypeDescription
attributePathStringSee [CompositeData] below.(#compositedata)
allowAdditionalKeysBooleanIf true, additional key properties other than those specified in keyProperties are allowed but ignored. If false, the keyProperties need to match exactly; additional keys in the name will lead to a mismatch.
calculateDeltaboolIf true, calculate the change in values of the given attribute. Value = attribute(t) - attribute(t-1). This is useful for monotonically increasing values.
calculateRateboolIf true, calculate the rate of changes per second. This is used in combination with calculateDelta to convert an absolute attribute (for example, Request Count) to a rate (for example, Requests per Second). Value = attribute / query interval.
aggregationStringAggregates multiple values if more than one MBean matches the domain and key property filter. Default aggregation is SUM. Available aggregations are: SUM, AVG, MIN, MAX. For example, you can use this attribute to aggregate all MemoryPools and calculate their SUM or MAX value.
splittingsListSet splittings.

AttributePath (CompositeData)

To extract values of individual keys returned as CompositeData type by an attribute, you need to use the attributePath mechanism and point to the key you're interested in.

For example, HeapMemoryUsage is a CompositeData type that returns the following list of value-key pairs:

plaintext
{ committed: integer, init: integer, max: integer, used: integer }

If you want to extract the value of used from the HeapMemoryUsage attribute, point the attributePath to the used key.

json
{ "customJmxMetrics": [ { "name": "java.lang.HeapMemoryUsage", "source": { "domain": "java.lang", "keyProperties": { "type": "Memory" }, "attribute": "HeapMemoryUsage", "attributePath": "get(\"used\")" } } ] }

Splittings

Splittings can be used to define additional dimensions for a metric.

json
"splittings": [ { "name": "dimension", "keyProperty": "name" } ]

Each splitting has the following mandatory attributes:

FieldTypeDescription
nameStringSets the name for this dimension.
keyPropertyStringDefines which key property of the ObjectName of an MBean is used for splitting. See the keyProperties attribute of the source.

The following example shows how to define a metric providing multiple dimensions within a single metric definition:

json
{ "customJmxMetrics": [ { "name": "java.lang.MemoryPoolUsage", "source": { "domain": "java.lang", "keyProperties": { "type": "MemoryPool", "name": "*" }, "attribute": "Usage", "attributePath": "get(\"used\")", "splittings": [ { "name": "memory_type", "keyProperty": "name" } ] } } ] }

Based on this metric definition, the following MBeans:

  • java.lang:type=MemoryPool,name=G1 Eden Space
  • java.lang:type=MemoryPool,name=G1 Survivor Space

will result in a single metric in Dynatrace with two dimensions:

  • java.lang.MemoryPoolUsage with the dimension memory_type=G1 Eden Space
  • java.lang.MemoryPoolUsage with the dimension memory_type=G1 Survivor Space

Monitoring

In the Dynatrace menu, go to Data explorer to analyze and chart your custom JMX metrics. If needed, you can pin your charts to a dashboard. In the following example, you can see the java.lang.MemoryPoolUsage metric split by the dimension memory_type:

Data explorer with z/OS JMX metrics

To get a list of metrics available in your monitoring environment, in the Dynatrace menu, go to Metrics to open the Metrics browser. In the following example, you can see the three metrics that we have created above:

Metrics browser with z/OS JMX metrics

Related topics
  • Metrics browser

    Browse metrics with the Dynatrace metrics browser.

  • Data explorer

    Query for metrics and transform results to gain desired insights.