Grafana with Java metrics

Setup Custom Metrics with Reactive Java, Spring Boot, Prometheus, Grafana and Docker Compose

A setup guideline for custom Java metrics

Szilárd Mátis
4 min readJun 5, 2024

--

In my previous articles we explored how to setup properly Grafana and Prometheus in Docker Compose and how to expose and monitor Java metrics with Prometheus and Grafana. The aim of this article is to look further into the monitoring possibilities with these tools by creating custom metrics in a Reactive Java project using Spring Boot.

This tutorial uses perquisites which are documented in the mentioned articles. The source code can be found on GitHub. You can check the articles here:

Micrometer metric types

In Java, we can use the Micrometer library to create our metrics. Micrometer supports timers…

--

--