![]() (Be sure to get the “&” at the end so that Zookeeper runs in the background! Otherwise, you’ll need to open another terminal to run Kafka.) OPTIONAL: Start jconsole Your path might look slightly different depending on the version of Kafka you downloaded.) (It should be included in the Kafka download. Kafka requires Zookeeper, so you’ll need to start that up first. Now that the JMX exporter is built, you can add it to the Java environment that Kafka will run in. Ls jmx_prometheus_javaagent/target/jmx*jar Running Kafka Once this is done, you’ll need to get the name of the binary that’s built, since it will be used later when starting Kafka: ![]() In order to build it, you’ll need to clone the repository and build with maven: git clone If you want to compare Java’s native JMX output to the data captured by the Prometheus exporter, install jconsole. Use the download link on the Kafka quickstart page to download Kafka, but don’t start it yet. Kafka binaries are prebuilt for many environments. You’ll also need to download a copy of Kafka. Note: This tutorial assumes that you have a Java development environment that includes maven and that you have a Grafana instance already deployed. I’ll build the JMX exporter, deploy Kafka, and bring its metrics into Grafana for monitoring. ![]() In this post, I’ll use Kafka as an example of a Java application that you want to monitor. The exporter connects to Java’s native metric collection system, Java Management Extensions (JMX), and converts the metrics into a format that Prometheus can understand. That’s the job of the Prometheus JMX Exporter. It was only created in 2012! Even though Java has had its own metric collectors since before Prometheus was born, none of our new environments speak its (metric) language. We all know that Prometheus is a popular system for collecting and querying metrics, especially in the cloud native world of Kubernetes and ephemeral instances.īut people forget that Java has been running enterprise software since 1995, while Prometheus is a relative newcomer to the scene.
0 Comments
Leave a Reply. |