There is no @EnableActuator annotation in Spring Boot, and there never was. Spring Boot Actuator is enabled by adding the spring-boot-starter-actuator dependency, after which auto-configuration registers the endpoints. You then choose which endpoints are exposed over HTTP with configuration properties.
Older answers that mention @EnableActuator are wrong. If you see it in a tutorial, it will not compile, because no such class exists in Spring Boot. The annotations that do exist are @Endpoint for custom endpoints and @EnableConfigurationProperties for settings.
Add the starter. Spring Boot's auto-configuration does the rest:
For Gradle:
No annotation on your main class is needed. With the starter on the classpath, endpoints are registered under the /actuator base path in Spring Boot 2.x and later, including the current Boot 3.x line.
Being registered is not the same as being reachable over HTTP. By default only a small set is exposed on the web, and the list is deliberately conservative for security reasons.
| Endpoint | Purpose | Exposed over HTTP by default |
|---|---|---|
health | Application and dependency health | Yes |
info | Arbitrary application information | No in Boot 2.5 and later |
metrics | Metrics from Micrometer | No |
env | Environment properties | No |
loggers | View and change log levels | No |
beans, mappings, threaddump | Diagnostics | No |
The default exposure rules have changed between versions, so confirm them in the Actuator documentation for the version you run.
Use the management.endpoints.web.exposure properties in application.yml:
You can use include: "*" to expose everything, but do that only in development. Excluding specific endpoints is possible with management.endpoints.web.exposure.exclude.
With this configuration, GET /actuator/health returns a status document such as:
With show-details enabled for the caller, the response also lists components such as the database and disk space.
Actuator endpoints can leak configuration, bean names and heap data, so never leave them open on a public interface. With Spring Security on the classpath, define a rule that treats Actuator separately from your application routes:
You can also move management traffic to a separate port with management.server.port, so it is not reachable through the public load balancer.
If you need your own endpoint, annotate a bean with @Endpoint and its operations with @ReadOperation:
Add release to the exposure list and it is served at /actuator/release.
Actuator health supports liveness and readiness groups, which Spring Boot enables automatically when it detects Kubernetes. They are served at /actuator/health/liveness and /actuator/health/readiness. For your own check, implement HealthIndicator:
No. Actuator is switched on by the starter dependency and configured through properties.
The endpoint is not exposed over the web by default. Add it to management.endpoints.web.exposure.include.
Yes, set management.endpoints.web.base-path, for example to /management.
Yes when you expose only what you need, secure it, and ideally serve it on a separate management port.
Actuator needs a dependency, not an annotation. Add spring-boot-starter-actuator, expose chosen endpoints through management.endpoints.web.exposure.include, secure them, and use @Endpoint or HealthIndicator for custom behaviour.