spring-boot-actuator
giuseppe-trisciuoglio/developer-kit
Production-grade monitoring, health checks, and metrics for Spring Boot services via Actuator and Micrometer.
What is spring-boot-actuator?
Configures Spring Boot Actuator endpoints, health probes, secured management ports, and Micrometer metrics exporters for production observability. Use when setting up monitoring, health checks, diagnostics, or metrics collection for Spring Boot applications.
- Expose and secure Actuator management endpoints (health, info, metrics, prometheus) with role-based access control
- Configure health probes (readiness and liveness) for container orchestrators and platform requirements
- Integrate Micrometer exporters (Prometheus, OTLP, Wavefront, StatsD) for metrics collection and SLO reporting
- Implement custom health indicators to monitor external dependencies and application-specific components
- Enable diagnostics endpoints (/startup, /conditions, /httpexchanges) for incident response and troubleshooting
- Isolate management traffic on dedicated ports with SSL/TLS and firewall controls
How to install spring-boot-actuator
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill spring-boot-actuator- Spring Boot 3.5.x or compatible version
- Maven or Gradle build configuration
- Spring Security for endpoint authentication (optional but recommended for production)
How to use spring-boot-actuator
- 1.Add spring-boot-starter-actuator dependency to your Maven or Gradle build file
- 2.Set management.endpoints.web.exposure.include to expose required endpoints (e.g., health, info, metrics, prometheus)
- 3.Apply Spring Security configuration using EndpointRequest to authenticate and authorize management traffic
- 4.Enable health probes with management.endpoint.health.probes.enabled=true and configure readiness/liveness groups
- 5.Configure Micrometer exporters (e.g., Prometheus) via management.metrics.export.* properties
- 6.Optionally isolate management traffic on a dedicated port using management.server.port and firewall rules
- 7.Verify endpoints respond correctly: curl http://localhost:8080/actuator/health and curl http://localhost:8080/actuator/prometheus
Use cases
- Bootstrap Actuator endpoints on a new Spring Boot service and expose health checks for load balancers
- Secure management endpoints with authentication and restrict sensitive endpoints like /env and /configprops to operators only
- Configure readiness and liveness probes to integrate with Kubernetes or other orchestrators
- Export application metrics to Prometheus for dashboarding and alerting on SLOs
- Debug auto-configuration issues and startup performance using /conditions and /startup endpoints
- Spring Boot developers building production services
- DevOps engineers setting up observability and health checks
- Platform engineers integrating Spring Boot with Kubernetes or cloud platforms
- SREs configuring metrics collection and incident diagnostics
spring-boot-actuator FAQ
Expose only required endpoints: health (public or authenticated), metrics/prometheus (operator-only), and info (public). Avoid exposing /env, /configprops, /logfile, /heapdump, /beans, and /mappings on public networks as they reveal sensitive configuration and internal structure.
Use Spring Security with EndpointRequest.toAnyEndpoint() to apply role-based rules. Optionally run management on a dedicated port (management.server.port) and enforce SSL/TLS. Keep /actuator/health publicly accessible only if required; otherwise enforce authentication.
Enable management.endpoint.health.probes.enabled=true to expose /health/readiness and /health/liveness. Group health indicators via management.endpoint.health.group.readiness.include to match your platform requirements. Ensure all mandatory components report UP before promoting to production.
Add spring-boot-starter-actuator, enable the prometheus endpoint in management.endpoints.web.exposure.include, and configure management.metrics.export.prometheus properties. Scrape /actuator/prometheus from your Prometheus server. Use MeterRegistryCustomizer beans to add application and environment tags.
Yes, extend HealthIndicator or ReactiveHealthContributor and register as a @Component. Include the indicator in your readiness group via management.endpoint.health.group.readiness.include. Keep checks fast (under 250 ms) to avoid blocking the event loop.
Full instructions (SKILL.md)
Source of truth, from giuseppe-trisciuoglio/developer-kit.
name: spring-boot-actuator description: 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. allowed-tools: Read, Write, Bash
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
<!-- 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
Instructions
1. Add Actuator Dependency
Include spring-boot-starter-actuator in your build configuration.
Validate: Restart the service and confirm
/actuator/healthand/actuator/inforespond with200 OK.
2. Expose Required Endpoints
- Set
management.endpoints.web.exposure.includeto the precise list or"*"for internal deployments. - Adjust
management.endpoints.web.base-path(e.g.,/management) when the default/actuatorconflicts with routing. - Review detailed endpoint semantics in
references/endpoint-reference.md.
Validate:
curl http://localhost:8080/actuatorreturns the list of exposed endpoints.
3. Secure Management Traffic
- Apply an isolated
SecurityFilterChainusingEndpointRequest.toAnyEndpoint()with role-based rules. - Combine
management.server.portwith firewall controls or service mesh policies for operator-only access. - Keep
/actuator/health/**publicly accessible only when required; otherwise enforce authentication.
Validate: Unauthenticated requests to protected endpoints return
401 Unauthorized.
4. Configure Health Probes
- Enable
management.endpoint.health.probes.enabled=truefor/health/livenessand/health/readiness. - Group indicators via
management.endpoint.health.group.*to match platform expectations. - Implement custom indicators by extending
HealthIndicatororReactiveHealthContributor; sample implementations inreferences/examples.md#custom-health-indicator.
Validate:
/actuator/health/readinessreturnsUPwith all mandatory components before promoting to production.
5. Publish Metrics and Traces
- Activate Micrometer exporters (Prometheus, OTLP, Wavefront, StatsD) via
management.metrics.export.*. - Apply
MeterRegistryCustomizerbeans to addapplication,environment, and business tags for observability correlation. - Surface HTTP request metrics with
server.observation.*configuration when using Spring Boot 3.2+.
Validate: Scrape
/actuator/prometheusand confirm required meters (http.server.requests,jvm.memory.used) are present.
6. Enable Diagnostics Tooling
- Turn on
/actuator/startup(Spring Boot 3.5+) and/actuator/conditionsduring incident response to inspect auto-configuration decisions. - Register an
HttpExchangeRepository(e.g.,InMemoryHttpExchangeRepository) before enabling/actuator/httpexchangesfor request auditing. - Consult
references/endpoint-reference.mdfor endpoint behaviors and limits.
Validate:
/actuator/startupand/actuator/conditionsreturn valid JSON payloads.
Examples
Basic – Expose health and info safely
management:
endpoints:
web:
exposure:
include: "health,info"
endpoint:
health:
show-details: never
Intermediate – Readiness group with custom indicator
@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
Advanced – Dedicated management port with Prometheus export
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.
Best Practices
- Keep SKILL.md concise and rely on
references/for verbose documentation to conserve context. - 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
curlprobes in CI/CD pipelines.
Constraints and Warnings
- Avoid exposing
/actuator/env,/actuator/configprops,/actuator/logfile, and/actuator/heapdumpon public networks. - 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.
- Never expose actuator endpoints without authentication in production environments.
- Health indicators should not perform expensive operations that could impact application performance.
- Be cautious with
/actuator/beansand/actuator/mappingsas they reveal internal application structure.
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 (
scripts/) reserved for future automation; no runtime dependencies today.
Validation Checklist
- Confirm
mvn spring-boot:runor./gradlew bootRunexposes expected endpoints under/actuator(or custom base path). - Verify
/actuator/health/readinessreturnsUPwith all mandatory components before promoting to production. - Scrape
/actuator/metricsor/actuator/prometheusto ensure required meters (http.server.requests,jvm.memory.used) are present. - Run security scans to validate only intended ports and endpoints are reachable from outside the trusted network.
Related skills
More from giuseppe-trisciuoglio/developer-kit and the wider catalog.

spring-boot-cache
Configure Spring Boot caching with Redis/Caffeine/EhCache, TTL policies, and @Cacheable/@CacheEvict annotations.

spring-boot-crud-patterns
Generate complete CRUD workflows for Spring Boot 3 services with DDD-inspired architecture and REST APIs.

spring-boot-dependency-injection
Constructor-first dependency injection patterns for Spring Boot services and configurations.

spring-boot-event-driven-patterns
Event-Driven Architecture patterns for Spring Boot with domain events, Kafka, and transactional outbox.

spring-boot-openapi-documentation
Generate OpenAPI 3.0 documentation and Swagger UI for Spring Boot 3.x REST APIs with SpringDoc

spring-boot-project-creator
Creates and scaffolds a new Spring Boot project (3.x or 4.x) by downloading from Spring Initializr, generating package structure (DDD or Layered architecture), configuring JPA, SpringDoc OpenAPI, and Docker Compose services (PostgreSQL, Redis, MongoDB). Use when creating a new Java Spring Boot project from scratch, bootstrapping a microservice, or initializing a backend application.