Provides patterns to configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services. Use when setting up monitoring, health checks, or metrics for Spring Boot applications.
references/.Follow these steps to configure Spring Boot Actuator for production-grade monitoring:
Include spring-boot-starter-actuator in your build configuration (Maven or Gradle).
Configure management.endpoints.web.exposure.include property with the specific endpoints you need. Avoid exposing sensitive endpoints like /env, /heapdump in production.
Apply Spring Security to management endpoints using @Configuration class with EndpointRequest matcher. Consider using a dedicated management port for additional isolation.
Enable readiness and liveness probes with management.endpoint.health.probes.enabled=true. Create health groups to aggregate relevant indicators.
Configure Micrometer registry for your monitoring system (Prometheus, OTLP, Wavefront). Add application tags for cross-service correlation.
Turn on /actuator/startup, /actuator/conditions, and /actuator/httpexchanges for incident response troubleshooting.
Test each endpoint is accessible and returns expected data. Verify health checks integrate with your orchestrator (Kubernetes, Cloud Foundry).
<!-- Maven -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
// Gradle
dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator"
}
/actuator/health and /actuator/info respond with 200 OK.management.endpoints.web.exposure.include to the precise list or "*" for internal deployments.management.endpoints.web.base-path (e.g., /management) when the default /actuator conflicts with routing.references/endpoint-reference.md.SecurityFilterChain using EndpointRequest.toAnyEndpoint() with role-based rules.management.server.port with firewall controls or service mesh policies for operator-only access./actuator/health/** publicly accessible only when required; otherwise enforce authentication.management.endpoint.health.probes.enabled=true for /health/liveness and /health/readiness.management.endpoint.health.group.* to match platform expectations.HealthIndicator or ReactiveHealthContributor; sample implementations live in references/examples.md#custom-health-indicator.management.metrics.export.*.MeterRegistryCustomizer beans to add application, environment, and business tags for observability correlation.server.observation.* configuration when using Spring Boot 3.2+./actuator/startup (Spring Boot 3.5+) and /actuator/conditions during incident response to inspect auto-configuration decisions.HttpExchangeRepository (e.g., InMemoryHttpExchangeRepository) before enabling /actuator/httpexchanges for request auditing.references/official-actuator-docs.md for endpoint behaviors and limits.