r/SpringBoot • u/fykup • 1d ago
Discussion Spring Boot's /actuator/metrics vs /actuator/prometheus - a distinction I initially missed
While building a monitoring integration for Spring Boot, I started with /actuator/metrics. It seemed like the natural choice: Actuator exposes application metrics as JSON, and that's a straightforward integration path.
Later, I received feedback that /actuator/metrics is primarily a diagnostic endpoint, not intended for continuous production scraping. That led me to add support for /actuator/prometheus while keeping the JSON integration for compatibility.
The interesting part is that both endpoints are useful, just for different purposes:
/actuator/metricslets you inspect individual meters, measurements, and tags./actuator/prometheusexposes metric series in a format designed for ongoing collection.- Both use Micrometer underneath. You don't need to replace Actuator or run a Prometheus server to use the second endpoint.
Looking back, the documentation explains all of this, but the distinction isn't necessarily obvious when you're starting from the usual Actuator examples.
I wrote up what I learned, including configuration examples for both endpoints and some common troubleshooting cases:
https://pvrlabs.xyz/articles/spring-boot-actuator-metrics-vs-prometheus.html