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.

Create a JMX extension

  1. Sign in to Dynatrace and go to Settings > Monitoring > Monitored technologies and click Add new technology monitoring. Of the four available options, one is Monitor Java or WebSphere based technologies. Click Add JMX/PMI extension.
  2. Click Use JMX/PMI extensions editor.
  3. Type the extension name. You can only use letters A-Z, a-z, numbers 0-9, or -/_.
  4. Add the metrics source.
  • Select one of the available technologies.
  • Based on your selection, the editor will suggest the Java process as a source for your metrics. This narrows the list of available MBeans or PMI modules you will use in the next step. The technology behind the process determines whether you'll browse JMX MBeans or PMI modules. Click Add metrics source to use a suggested source. Click Edit pen to select a different process. When selecting it, you can narrow the list of available processes by choosing a particular host or Management Zone.

Note

Selecting the process, host, or Management Zone doesn't limit the extension monitoring scope. JMX/PMI extensions monitor all Java processes accessible to OneAgent. The metric defined for the same MBean and attribute will be also available in other Java processes across your application, which can quickly exhaust your custom metric limit.

You can also select individual hosts on which to run your new JMX extension, instead of running it globally across your whole environment.

  1. Immediately after you add your JMX extension, go to Settings> Monitored technologies > Custom extensions tab and disable it globally.
  2. Navigate to individual host pages, open the host settings, find your JMX extension and enable it.
  1. When the metrics list is downloaded, click the Add metric button to start creating your extension.

    Domain

    Select the domain.

    Select key properties

    Key properties filter the list of available MBeans. Note that property values can contain wildcards. Select Exact match to filter MBeans list only to the entries matching the exact key property values.

    Select MBean

    Select one MBean from the list or leave All matching MBeans option. If more than one MBean is matched, this will cause the aggregation of attributes from all matching MBeans into one metric. You will define the aggregation type below.

    Select attribute

    The attributes available in the list are only the numeric ones. To see other attributes, for example attributes of the String type, select Include non-numeric attributes. Note that selected attributes must be parsable to double, or boolean type. Otherwise, Dynatrace OneAgent will not collect any data from such a metric.

    Display name

    You can define a custom display name for the metric.

    Unit

    Select the metric unit.

    Aggregation

    Select the aggregation method if you're pulling an attribute from a number of matching Mbeans.

    Calculation

    Delta calculates the change in values of the given attribute. Rate calculates the rate of changes per seconds. When you select both, you can convert an absolute attribute (eg. Request Count) to a rate (eg. Requests per Second). Value = attribute / query interval.

Creating the PMI extension

Creating the PMI extension is very similar to the JMX extension. PMI Module translates to JMX Mbean and statistics to attributes. All other settings behave accordingly.

Saving the extension

After you add the metric, you can still edit or delete its definition. You must click the Save button to register the extension and start collecting data from all Java processes that contain defined MBeans. After you save the extension, you cannot edit or delete the metrics, as this way we're able to maintain the continuity of your data. You can still add the new metrics. This time however, you won't be able to select the base Java process, because you will use a process where the extension is already deployed.

Customizing your extension

The Dynatrace JMX extensions are highly customizable beyond the capabilities of the editor. You can download your extension and edit its JSON file that describes your JMX metrics and how you want to display them. For reference and examples, see Customizing JMX Plugins.

Viewing JMX metrics in Dynatrace

Note:
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.

JMX metrics

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 metrics