The spring-boot-starter-actuator dependency adds production-ready monitoring and management features to a Spring Boot application. It exposes endpoints such as /actuator/health and /actuator/metrics and wires in Micrometer, so you can check health, collect metrics and inspect configuration without writing that code yourself.
Out of the box only a small set of endpoints is reachable over HTTP, and you decide which others to expose and who may call them. Treat actuator like an admin interface: expose the minimum, and secure the rest.
Adding the starter brings in spring-boot-actuator, its auto-configuration and Micrometer, the metrics facade used by Spring Boot. The main capabilities are:
loggers (change log levels at runtime), threaddump and heapdump.For Maven, add the starter without a version, because Spring Boot manages it:
For Gradle use implementation 'org.springframework.boot:spring-boot-starter-actuator'. After you start the application, call the health endpoint:
| Endpoint | Purpose | Exposed over HTTP by default |
|---|---|---|
/actuator/health | Application and dependency health | Yes |
/actuator/info | Build, Git and custom info | No (since Spring Boot 2.5) |
/actuator/metrics | List of metric names, drill into one with /actuator/metrics/jvm.memory.used | No |
/actuator/env | Properties and environment | No |
/actuator/loggers | Read and change log levels at runtime | No |
/actuator/prometheus | Metrics in Prometheus format, needs a Prometheus registry | No |
/actuator/threaddump, /actuator/heapdump | Diagnostics | No |
Only health is exposed over HTTP by default. The list of endpoints is available at /actuator, as links.
Use management.endpoints.web.exposure.include to choose the endpoints, and management.endpoint.<id>.* to configure one endpoint. A typical application.properties:
Notes on these settings:
include=* exposes every endpoint. Avoid it on a public port, because env, heapdump and threaddump can leak secrets and internals.show-details accepts never, when-authorized and always. Without show-details the health endpoint only returns the overall status.env and configprops are masked by default; do not rely on masking alone.Implement HealthIndicator to include your own checks in /actuator/health:
The indicator name comes from the class name without the HealthIndicator suffix, so this one appears as paymentGateway. Keep checks fast, because the endpoint is called often by load balancers and orchestrators.
When Spring Security is on the classpath, every endpoint except those you permit requires authentication, unless you define your own SecurityFilterChain. A common setup lets health checks through and restricts the rest to an admin role:
Do not store passwords in plain properties for real systems. Use a proper user store, OAuth 2 or network isolation.
Actuator publishes metrics through Micrometer, which can export to many systems. For Prometheus add the registry dependency, and the /actuator/prometheus endpoint appears when it is exposed:
Prometheus scrapes that endpoint, and Grafana can chart the data. Spring Boot also supports exporting through OpenTelemetry and other Micrometer registries. The original /actuator/metrics endpoint only lists and shows individual metrics as JSON; it is not the Prometheus format.
Most endpoints are enabled, but only health is exposed over HTTP. You expose more with management.endpoints.web.exposure.include.
Yes, if you expose only what you need, secure sensitive endpoints and ideally serve them on an internal management port. Exposing env, heapdump or loggers publicly is a security risk.
Set management.endpoint.health.probes.enabled=true. Then /actuator/health/liveness and /actuator/health/readiness are available for the pod probes. Spring Boot enables them automatically when it detects a Kubernetes environment.
Yes, with management.endpoints.web.base-path=/management. Combine it with a separate port for extra isolation.
The spring-boot-starter-actuator dependency gives you health checks, Micrometer metrics, runtime diagnostics and operational endpoints with almost no code. Expose a small set of endpoints, add custom health indicators for critical dependencies, secure the sensitive ones and export metrics to Prometheus or another backend.