بنقرة واحدة
spring-boot-actuator
Use when configuring Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, readiness/liveness checks, and Micrometer metrics in Spring Boot 4 applications.
القائمة
Use when configuring Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, readiness/liveness checks, and Micrometer metrics in Spring Boot 4 applications.
Use when building Model Context Protocol servers in Spring Boot with Spring AI, exposing tools or resources, configuring transports, or integrating AI tool-calling workflows.
Use when adding caching to Spring Boot 4 services, configuring cache providers and TTL policies, invalidating stale data, or diagnosing cache hit and miss behavior.
Use when integrating Neo4j into a Spring Boot 4 backend with graph models, Cypher queries, reactive repositories, relationship mapping, or graph-focused testing patterns.
Use when implementing event-driven or message-based integration in Spring Boot 4, publishing domain events, coordinating Kafka or broker messaging, or applying outbox and idempotency patterns for reliable delivery.
Use when documenting reactive Spring Boot 4 HTTP APIs with SpringDoc OpenAPI, configuring Swagger UI, annotating endpoints, documenting security schemes, or defining request and response schemas.
Use when implementing reactive fault-tolerance patterns in Spring Boot 4 with native Spring Framework 7 resilience features or Resilience4j, including retries, concurrency limiting, circuit breakers, rate limiting, timeouts, and fallbacks for downstream calls.
| name | spring-boot-actuator |
| description | Use when configuring Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, readiness/liveness checks, and Micrometer metrics in Spring Boot 4 applications. |
| allowed-tools | Read, Write, Bash |
references/.<!-- Maven -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
// Gradle
dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator"
}
After adding the dependency, verify endpoints respond:
curl http://localhost:8080/actuator/health
curl http://localhost:8080/actuator/info
Include spring-boot-starter-actuator in your build configuration.
Validate: Restart the service and confirm
/actuator/healthand/actuator/inforespond with200 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.Validate:
curl http://localhost:8080/actuatorreturns the list of exposed endpoints.
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.Validate: Unauthenticated requests to protected endpoints return
401 Unauthorized.
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 in references/examples.md#custom-health-indicator.Validate:
/actuator/health/readinessreturnsUPwith all mandatory components before promoting to production.
management.metrics.export.*.MeterRegistryCustomizer beans to add application, environment, and business tags for
observability correlation.server.observation.* configuration when using Spring Boot
3.2+.Validate: Scrape
/actuator/prometheusand confirm required meters (http.server.requests,jvm.memory.used) are present.
/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/endpoint-reference.md for endpoint behaviors and limits.Validate:
/actuator/startupand/actuator/conditionsreturn valid JSON payloads.
management:
endpoints:
web:
exposure:
include: "health,info"
endpoint:
health:
show-details: never
@Component
public class PaymentsGatewayHealth implements HealthIndicator {
private final PaymentsClient client;
public PaymentsGatewayHealth(PaymentsClient client) {
this.client = client;
}
@Override
public Health health() {
boolean reachable = client.ping();
return reachable ? Health.up().withDetail("latencyMs", client.latency()).build()
: Health.down().withDetail("error", "Gateway timeout").build();
}
}
management:
endpoint:
health:
probes:
enabled: true
group:
readiness:
include: "readinessState,db,paymentsGateway"
show-details: always
management:
server:
port: 9091
ssl:
enabled: true
endpoints:
web:
exposure:
include: "health,info,metrics,prometheus"
base-path: "/management"
metrics:
export:
prometheus:
descriptions: true
step: 30s
endpoint:
health:
show-details: when-authorized
roles: "ENDPOINT_ADMIN"
@Configuration
public class ActuatorSecurityConfig {
@Bean
SecurityFilterChain actuatorChain(HttpSecurity http) throws Exception {
http.securityMatcher(EndpointRequest.toAnyEndpoint())
.authorizeHttpRequests(c -> c
.requestMatchers(EndpointRequest.to("health")).permitAll()
.anyRequest().hasRole("ENDPOINT_ADMIN"))
.httpBasic(Customizer.withDefaults());
return http.build();
}
}
More end-to-end samples are available in references/examples.md.
references/ for verbose documentation to conserve context.curl probes in CI/CD pipelines./actuator/env, /actuator/configprops, /actuator/logfile, and
/actuator/heapdump on public networks./actuator/beans and /actuator/mappings as they reveal internal application
structure.scripts/) reserved for future automation; no runtime dependencies today.mvn spring-boot:run or ./gradlew bootRun exposes expected endpoints under
/actuator (or custom base path)./actuator/health/readiness returns UP with all mandatory components before promoting to
production./actuator/metrics or /actuator/prometheus to ensure required meters (
http.server.requests, jvm.memory.used) are present.