JMX

Summary

The JMX collector uses Jolokia to collect data on your MBeans. Jolokia is an agent that provides access to JMX MBeans without having to write any Java code. Metricly can be used to process and graph the data collected by Jolokia. This can be useful if you’d like to collect a small set of metrics via JMX e.g., garbage collection metrics on your Cassandra cluster.

Java Integration Options

We have several different options for monitoring Java applications. Each method varies in terms of setup difficulty and the amount / type of information it collects. See the table below for more information.

Method Description
Ananke Java library you can use to push metrics to the StatsD listener embedded in our Linux agent.

his approach requires that you integrate the StatsDReporter into your applications.
Dropwizard Integrate the dropwizard-metrics library into your Dropwizard application and configure it to send metrics to the StatsD listener embedded in ourLinux agent.
Iris Java library you can use to push metrics directly to Metricly’s REST API.
Java Agent Open-source and open-license Java agent the does the byte-code instrumentation for you. No changes to source code required.
JMX Integration that relies on our Linux agent to collect JVM metrics (e.g., heap size, garbage collection, etc.) without code-level instrumentation.

Configuration

If you haven’t installed the Linux agent already, see the instructions on this page for how to install it. If you need to disable the Linux integration or view the unique API key assigned to your account, navigate to the Integrationspage under the user account drop-down menu and click the integration designated as Infrastructure under the Integration column.

Collector Configuration

  1. Download the Jolokia JVM JAR file.
    1. Move the downloaded file to the /opt/netuitive-agent/ directory.
    2. Pass the Java agent parameter into your application.
      -javaagent:/opt/agent.jar=port=8778,host=0.0.0.0
  2. Navigate to the collectors folder.
    The default location is /opt/netuitive-agent/conf/collectors.
  3. Open the JolokiaCollector.conf file.
    This configuration file will only be available in agent versions 0.3.1 or later. Otherwise, you will have to create a configuration file with the same name.
  4. Change the enabled setting to True.
  5. Save the configuration file, and restart the Linux Agent.

Additional Configuration Options

Option Default Description
enabled False Enable collecting Jolokia metrics.
host localhost Hostname to collect from.
port 8778 Port to collect from.
path jmx The metric prefix, e.g., how you want the metrics to show up in Metricly.
jolokia_path jolokia Part of the URL path that points to where your application serves metrics. Typically jmx or jolokia.
mbeans java.* Pipe ( | ) delimited list of MBeans for which to collect stats. If no list is provided, all MBeans stats will be collected.
regex true Enables the mbeans option to match with regex.
byte_unit Default numeric output(s).
measure_collector_time Measure the collector’s run time in milliseconds.
metrics_blacklist Regex list to match metrics to block. Mutually exclusive with metrics_whitelistoption.
metrics_whitelist Regex list to match metrics to transmit. Mutually exclusive with metrics_blacklistoption.
password Password used for authentication.
rewrite Config sub-section that contains pairs of from-to regex rewrites.

The rewrite subsection should exist directly underneath the mbeans option like so:


mbeans = "..."
[rewrite]
java = coffee
"-v\d+\.\d+\.\d+" = "-AllVersions"
".*Gets2Activities.*" = ""...
username Username used for authentication.

Dependencies

OS
Redhat 6 and 7
CentOS 6 and 7
Amazon Linux (latest)
Ubuntu 12, 14, 15, and 16
Debian 7, 8, and 9
Miscellaneous
Linux Agent
Jolokia
A running JVM with Jolokia installed/configured