Actuator

Basic Spring
≈ 1 min read

A technical view of a running application

After an application starts, it is important to know more than just “does it answer requests?”. You also need to know whether the process is healthy, which observations are available, and what is happening with the infrastructure. Spring Boot Actuator adds ready-made technical endpoints for these tasks.

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-actuator")
}

After the starter is added, the application receives a set of actuator capabilities. One of the best-known endpoints is /actuator/health, which reports the application state. Metrics and other diagnostic information are also available when the corresponding endpoints are enabled.

Expose only what you actually need

management.endpoints.web.exposure.include=health,info,metrics

This setting explicitly lists the endpoints that should be available over HTTP. In production, such endpoints are usually treated as part of an administrative interface, not as a public API for every user.

Do not expose every actuator endpoint “just in case”. Diagnostic information may reveal details about the application and its environment. The exposed endpoint set and access rules should be intentional.