# jmxtrans

> How to send metrics from Java-based applications to Last9 using jmxtrans

Source: https://last9.io/docs/integrations/others/jmxtrans/

[jmxtrans](https://github.com/jmxtrans/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 Last9.

## Pre-requisites

1. You have created a Last9 cluster by following the [getting started guide](/docs/onboard/)
2. Clone [last9-integrations](https://github.com/last9/last9-integrations/tree/master/levitate/remote-write/telegraf) GitHub repository contains the sample code with different approaches discussed in this article

## Setup

![jmxtrans using Graphite output plugin](../../../../../assets/content/docs/integrations/others/jmxtrans/da27781-image.png)

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 Last9

A complete example using this approach can be found [here](https://github.com/last9/last9-integrations/tree/master/levitate/remote-write/jmxtrans).

## Next steps

Create a read token for your Last9 Cluster and follow our guide to
[Configure Grafana](/docs/grafana-config/) to visualize the time series data getting sent to Last9.

---

## Troubleshooting

Please get in touch with us on [Discord](https://discord.com/invite/Q3p2EEucx9) or [Email](mailto:support@last9.io) if you have any questions.
