The /actuator/metrics endpoint of Spring Boot Actuator lists the application's Micrometer metrics (JVM memory, garbage collection, threads, HTTP server requests, connection pools and your own custom meters) and returns the current value of any one metric you ask for. It is the quickest way to inspect runtime behaviour, and the same meters feed monitoring systems such as Prometheus.
It is a diagnostic endpoint, not a time-series store. It shows the current measurements, so for history and alerting you export the same metrics to a monitoring backend.
Spring Boot Actuator uses Micrometer, a metrics facade, to record measurements. Calling GET /actuator/metrics returns the list of available metric names, and GET /actuator/metrics/{name} returns details for one.
Common groups of metrics include:
| Group | Example names |
|---|---|
| JVM memory and GC | jvm.memory.used, jvm.gc.pause |
| Threads and classes | jvm.threads.live, jvm.classes.loaded |
| CPU and system | process.cpu.usage, system.cpu.usage, disk.free |
| HTTP server | http.server.requests |
| Datasource pool | hikaricp.connections.active, jdbc.connections.active |
| Cache, Tomcat, Kafka and more | Added when the matching libraries are present |
The exact list depends on your Spring Boot version and the libraries on the classpath.
Add the Actuator starter.
By default over HTTP only the health endpoint is exposed. Expose metrics explicitly:
Because metrics reveal internals, secure the endpoint. Put Actuator on a separate management port, restrict it with Spring Security, or keep it off the public network.
Request one metric by name to see its measurements and the tags you can filter on.
Narrow the result with one or more tag query parameters:
Here COUNT is the number of requests, TOTAL_TIME the summed duration, and MAX the longest recent request. Average latency is TOTAL_TIME / COUNT.
Inject a MeterRegistry to add your own meters. They appear at /actuator/metrics automatically.
After the first call, GET /actuator/metrics/orders.placed returns the counter. For timing code, use Timer, and for values that go up and down, such as queue size, use a Gauge.
The /actuator/metrics endpoint is for humans and ad hoc checks. Monitoring systems scrape a backend-specific endpoint instead. For Prometheus, add the Micrometer registry and expose /actuator/prometheus.
Prometheus scrapes that endpoint on an interval and stores the history. Grafana then draws dashboards from it, and Prometheus alert rules can notify you when, for example, the 5xx rate or heap usage crosses a threshold. Micrometer also supports other backends, such as Datadog, New Relic and OTLP.
Either the Actuator starter is missing or metrics is not in management.endpoints.web.exposure.include. The endpoint is not exposed over HTTP by default.
No. The first returns JSON for one metric at a time, while the second returns every meter in the Prometheus text format for scraping.
No. Metrics reveal internals such as URIs, pool sizes and versions. Secure the endpoint and prefer a private management port.
No. It reports current values only. Use Prometheus or another backend for history.
/actuator/metrics lists and reads Micrometer meters so you can check JVM, HTTP, database and custom metrics at runtime. Expose it deliberately, secure it, filter with tag parameters, and export the same meters to Prometheus or another backend when you need history, dashboards and alerts.