spring-boot-actuator
Original:🇺🇸 English
Translated
Configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services.
23installs
Added on
NPX Install
npx skill4agent add giuseppe-trisciuoglio/developer-kit spring-boot-actuatorTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Spring Boot Actuator Skill
Overview
- Deliver production-ready observability for Spring Boot services using Actuator endpoints, probes, and Micrometer integration.
- Standardize health, metrics, and diagnostics configuration while delegating deep reference material to .
references/ - Support platform requirements for secure operations, SLO reporting, and incident diagnostics.
When to Use
- Trigger: "enable actuator endpoints" – Bootstrap Actuator for a new or existing Spring Boot service.
- Trigger: "secure management port" – Apply Spring Security policies to protect management traffic.
- Trigger: "configure health probes" – Define readiness and liveness groups for orchestrators.
- Trigger: "export metrics to prometheus" – Wire Micrometer registries and tune metric exposure.
- Trigger: "debug actuator startup" – Inspect condition evaluations and startup metrics when endpoints are missing or slow.
Quick Start
- Add the starter dependency.
xml
<!-- Maven --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>gradle// Gradle dependencies { implementation "org.springframework.boot:spring-boot-starter-actuator" } - Restart the service and verify and
/actuator/healthrespond with/actuator/info.200 OK
Implementation Workflow
1. Expose the required endpoints
- Set to the precise list or
management.endpoints.web.exposure.includefor internal deployments."*" - Adjust (e.g.,
management.endpoints.web.base-path) when the default/managementconflicts with routing./actuator - Review detailed endpoint semantics in .
references/endpoint-reference.md
2. Secure management traffic
- Apply an isolated using
SecurityFilterChainwith role-based rules.EndpointRequest.toAnyEndpoint() - Combine with firewall controls or service mesh policies for operator-only access.
management.server.port - Keep publicly accessible only when required; otherwise enforce authentication.
/actuator/health/**
3. Configure health probes
- Enable for
management.endpoint.health.probes.enabled=trueand/health/liveness./health/readiness - Group indicators via to match platform expectations.
management.endpoint.health.group.* - Implement custom indicators by extending or
HealthIndicator; sample implementations live inReactiveHealthContributor.references/examples.md#custom-health-indicator
4. Publish metrics and traces
- Activate Micrometer exporters (Prometheus, OTLP, Wavefront, StatsD) via .
management.metrics.export.* - Apply beans to add
MeterRegistryCustomizer,application, and business tags for observability correlation.environment - Surface HTTP request metrics with configuration when using Spring Boot 3.2+.
server.observation.*
5. Enable diagnostics tooling
- Turn on (Spring Boot 3.5+) and
/actuator/startupduring incident response to inspect auto-configuration decisions./actuator/conditions - Register an (e.g.,
HttpExchangeRepository) before enablingInMemoryHttpExchangeRepositoryfor request auditing./actuator/httpexchanges - Consult for endpoint behaviors and limits.
references/official-actuator-docs.md
Examples
Basic – Expose health and info safely
yaml
management:
endpoints:
web:
exposure:
include: "health,info"
endpoint:
health:
show-details: neverIntermediate – Readiness group with custom indicator
java
@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();
}
}yaml
management:
endpoint:
health:
probes:
enabled: true
group:
readiness:
include: "readinessState,db,paymentsGateway"
show-details: alwaysAdvanced – Dedicated management port with Prometheus export
yaml
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"java
@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.mdBest Practices
- Keep SKILL.md concise and rely on for verbose documentation to conserve context.
references/ - Apply the principle of least privilege: expose only required endpoints and restrict sensitive ones.
- Use immutable configuration via profile-specific YAML to align environments.
- Monitor actuator traffic separately to detect scraping abuse or brute-force attempts.
- Automate regression checks by scripting probes in CI/CD pipelines.
curl
Constraints
- Avoid exposing ,
/actuator/env,/actuator/configprops, and/actuator/logfileon public networks./actuator/heapdump - Do not ship custom health indicators that block event loop threads or exceed 250 ms unless absolutely necessary.
- Ensure Actuator metrics exporters run on supported Micrometer registries; unsupported exporters require custom registry beans.
- Maintain compatibility with Spring Boot 3.5.x conventions; older versions may lack probes and observation features.
Reference Materials
- Endpoint quick reference
- Implementation examples
- Official documentation extract
- Auditing with Actuator
- Cloud Foundry integration
- Enabling Actuator features
- HTTP exchange recording
- JMX exposure
- Monitoring and metrics
- Logging configuration
- Metrics exporters
- Observability with Micrometer
- Process and Monitoring
- Tracing
- Scripts directory () reserved for future automation; no runtime dependencies today.
scripts/
Validation Checklist
- Confirm or
mvn spring-boot:runexposes expected endpoints under./gradlew bootRun(or custom base path)./actuator - Verify returns
/actuator/health/readinesswith all mandatory components before promoting to production.UP - Scrape or
/actuator/metricsto ensure required meters (/actuator/prometheus,http.server.requests) are present.jvm.memory.used - Run security scans to validate only intended ports and endpoints are reachable from outside the trusted network.