Skip to main content

jmxtrans

How to send metrics from Java-based applications to Levitate using jmxtrans

Introduction

jmxtrans is one of the common tools used to extract metrics from JVM via JMX and translate them into a variety of output metric formats e.g. statsd, telegraf, etc.

This document will showcase how to use your existing jmxtrans setup to emit metrics to Levitate.

Pre-requisites

  1. You have created a Levitate cluster by following the getting started guide.
  2. Clone last9-integrations GitHub repository contains the sample code with different approaches discussed in this article.

Setup

jmxtrans using Graphite output plugin

The setup primarily has 3 components.

  1. The Java Application is the application under observation for monitoring. It exposes a JMX interface.
  2. A jmxtrans container queries the jmx endpoint exposed by the Java application for metrics and converts them into graphite output format. These metrics are pushed to vmagent.
  3. vmagent reads the data in the graphite format converts it into Prometheus-compatible format and remote writes to Levitate.

A complete example using this approach can be found here.

Next steps

Create a read token for your Levitate Cluster and follow our guide to Configure Grafana to visualize the time series data getting sent to Levitate.

Troubleshooting

Please get in touch with us on Discord or Email if you have any questions.