Actuator Endpoints — A Window Into the Running App
library-service is live, and the hosting platform asks a simple question every ten seconds: "Are you alive?" Later, an engineer wants to know which beans loaded, which URLs are mapped, and how much memory is in use, without attaching a debugger to production. Spring Boot Actuator answers all of these through ready-made endpoints.
The rule
Actuator builds many endpoints, but over HTTP it shows only health until you choose more.
Add one starter:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>Endpoints appear under the /actuator base path. Two separate ideas control them:
- Enabled means the endpoint exists in the app at all. Most are enabled by default.
shutdownis the exception, and it stays off unless you deliberately turn it on. - Exposed means it can be reached over a given channel. Over HTTP, only
healthis exposed by default.
You choose what to expose over the web with one property:
management.endpoints.web.exposure.include=health,info,metricsA few endpoints worth knowing:
| Endpoint | Shows |
|---|---|
/actuator/health |
Whether the app and its dependencies are up |
/actuator/info |
Build and app information you choose to publish |
/actuator/metrics |
Measurements such as memory, request timings, pool usage |
/actuator/beans |
Every bean in the application context |
/actuator/mappings |
Every URL mapped to a controller method |
/actuator/env |
Configuration properties and where each came from |
/actuator/loggers |
Log levels, which you can change while running |
/actuator/conditions |
The auto-configuration condition report |
You can also move all of them to a separate port, management.server.port=8081, so the public load balancer only ever sees the API port.