Our JMX integration allows users to monitor any application that exposes metrics with JMX. The integration includes a default collection file that automatically collects key metrics from the JVM. You can also customize your metric collection with YAML files to collect any subset of metrics.
Read on to install the integration, and to see what data we collect.
Our integration is compatible with Java 8 or higher. If you need to use a different Java version than the one configured in
PATH, follow New Relic's configuration documentation on GitHub.
Before installing the integration, make sure that you meet the following requirements:
- A New Relic account. Don't have one? Sign up for free! No credit card required.
- If JMX is not running on Kubernetes or Amazon ECS, you must install the infrastructure agent on a host that's running JMX. Otherwise:
- This integration does not support the IIOP protocol.
To install the JMX integration, follow the instructions for your environment:
- Advanced: Integrations are also available in tarball format to allow for install outside of a package manager.
- When the Infrastructure agent executes the
nri-jmxbinary, it sets the path to
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin. The java binary must be in one of those paths.
jmxneed java binaries to be in the system
PATH, which is NOT the
PATHfor the root user, and isn't affected if you change the
PATHenvironment variable in
/root/.bashrc. Read more on how to change the PATH system variable.
- On-host integrations do not automatically update. For best results, regularly update the integration package and the infrastructure agent.
Metrics are sent and stored in the form of samples. This is a list of key-value pairs that include metric data and metadata. Each sample is stored as an event in our database.
You are responsible for creating and naming the JMX data reported to New Relic. For this reason, New Relic strongly recommends following these conventions when naming your event types. To ensure you have a consistent naming scheme:
- Use camel case.
- Use a name that clearly identifies what data it contains.
Recommendation: Use the same naming scheme for similar metrics across different applications.
Data from this service is reported to an integration dashboard.
JMX data is attached to the user-defined event type specified in the configuration file. For example, if you are interested in monitoring Tomcat using the JMX integration, define an
TomcatSample, and query that event type.
You can query this data for troubleshooting purposes or to create custom charts and dashboards.
For more on how to find and use your data, see Understand integration data.
The metrics generated by the integration include metadata associated with the MBean they are collecting from. You can use this metadata in NRQL queries to filter and facet the data so that the query returns only the data for the desired beans. It can also be used to uniquely identify the metrics, since the metric name is not necessarily unique between all beans.
Each event contains the following metadata:
The JMX domain name for these metrics.
The JMX domain name for these metrics with the entity type “domain:” prepended.
The JMX host the metrics are being collected from.
The query used to collect these metrics.
The bean whose attributes these metrics were collected from.
For each key in the bean name, an attribute is added to the metric set called
Here's an example NRQL query taking advantage of metadata monitor all the collected JVM garbage collectors:
SELECT latest(CollectionTime)FROM JVMSampleFACET `key:name`WHERE `key:type` = 'GarbageCollector'
The JMX integration collects the following metric data attributes:
The total Java heap memory used.
The total Java heap memory committed to be used.
The initial Java heap memory allocated.
The maximum Java heap memory available.
The total Java non-heap memory used.
The total Java non-heap memory committed to be used.
The initial Java non-heap memory allocated.
The maximum Java non-heap memory available.
The number of live threads.
The total number of garbage collections that have occurred.
The approximate accumulated garbage collection time elapsed.
The JMX integration captures the configuration parameters of the JMX integration. The data is available on the Inventory page, under the config/jmx source. For more about inventory data, see Understand integration data.
This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it.