Back to Backend Development

spring-boot-actuator

Spring BootActuatorJavaMonitoringHealth ChecksMetricsObservabilityDevOps
⭐ 282πŸ“„ MITπŸ•’ 2026-06-15Source β†—

Install this skill

npx skills add giuseppe-trisciuoglio/developer-kit

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

Spring Boot Actuator integrates diagnostic and monitoring features into your application by providing production-ready HTTP and JMX endpoints. It exposes internal application state, such as health status, environmental properties, bean configurations, and request metrics, without requiring manual instrumentation. By surfacing this data, the module enables automated operational tasks like infrastructure health checking, Prometheus-based metric aggregation, and runtime auditing. The system relies on Micrometer for standardized metric collection and offers granular control over which endpoints remain exposed for security. Actuator simplifies the path to satisfying Kubernetes liveness and readiness probe requirements, providing a structured way to report service status and perform deep internal diagnostics during production incidents. It effectively bridges the gap between raw application code and platform-level visibility, ensuring operators can manage services via standardized tooling rather than custom, ad-hoc monitoring scripts.

When to Use This Skill

  • β€’Satisfying Kubernetes container startup and readiness verification requirements
  • β€’Aggregating application performance metrics for dashboard visualization
  • β€’Inspecting runtime configuration during troubleshooting sessions
  • β€’Auditing recent HTTP exchanges for request/response debugging

How to Invoke This Skill

Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:

  • β€œenable actuator for my spring boot application
  • β€œhow do i add health and liveness probes in spring
  • β€œsecure actuator management endpoints with spring security
  • β€œexport spring boot metrics to prometheus
  • β€œconfigure custom health indicators for external database connections

Pro Tips

  • πŸ’‘Always customize `management.endpoints.web.base-path` to a non-default, obscure path for enhanced security, making it harder for attackers to discover Actuator endpoints.
  • πŸ’‘Leverage the `/startup` endpoint to diagnose slow application startup times and identify problematic beans during initialization.
  • πŸ’‘Integrate Actuator with a centralized log management system to correlate health checks and metrics with application logs for quicker incident resolution.

What this skill does

  • β€’Exposes built-in endpoints for health, info, metrics, and environment inspection
  • β€’Integrates with Kubernetes liveness and readiness probes
  • β€’Provides standardized metrics export for systems like Prometheus and Datadog
  • β€’Supports custom health indicators to track external dependency status
  • β€’Enables secure, role-based access control for administrative endpoints

When not to use it

  • βœ•Exposing sensitive internal service state in non-secure environments
  • βœ•Replacing dedicated full-stack APM tools when deep distributed tracing is required

Example workflow

  1. Add the spring-boot-starter-actuator dependency to your build file
  2. Define the management endpoint base path and exposure settings in application.yml
  3. Implement a custom HealthIndicator bean to monitor external service dependencies
  4. Configure a SecurityFilterChain to restrict management access by user role
  5. Enable probe groups to align with Kubernetes liveness/readiness specifications

Prerequisites

  • –Spring Boot framework project
  • –Micrometer library for metrics collection

Pitfalls & limitations

  • !Accidentally exposing sensitive info or environment variables via broad wildcard inclusion
  • !Performance overhead when enabling high-frequency metrics or full HTTP request tracing
  • !Default actuator paths causing security leaks if management ports are not properly firewalled

FAQ

Should I expose all actuator endpoints by default?
No. Always whitelist only the specific endpoints required for your operations to prevent leaking sensitive application metadata.
Can I hide the details of a health check?
Yes. Set 'management.endpoint.health.show-details' to 'never' or 'when-authorized' to control who sees granular diagnostic data.
Why use a separate management port?
Using a dedicated management port allows you to isolate monitoring traffic on a internal network while keeping the main application port for public traffic.

How it compares

Unlike manual logging or custom status servlets, Actuator provides a standardized, industry-accepted schema that works immediately with standard DevOps tooling.

Source & trust

⭐ 282 starsπŸ“„ MITπŸ•’ Updated 2026-06-15
πŸ“„ Full skill instructions β€” original source: giuseppe-trisciuoglio/developer-kit
# 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
1. Add the starter dependency.
<!-- Maven -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

// Gradle
dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator"
}

2. Restart the service and verify /actuator/health and /actuator/info respond with 200 OK.

## Implementation Workflow

### 1. Expose the required endpoints
- Set management.endpoints.web.exposure.include to the precise list or "*" for internal deployments.
- Adjust management.endpoints.web.base-path (e.g., /management) when the default /actuator conflicts with routing.
- Review detailed endpoint semantics in references/endpoint-reference.md.

### 2. Secure management traffic
- Apply an isolated SecurityFilterChain using EndpointRequest.toAnyEndpoint() with role-based rules.
- Combine management.server.port with firewall controls or service mesh policies for operator-only access.
- Keep /actuator/health/** publicly accessible only when required; otherwise enforce authentication.

### 3. Configure health probes
- Enable management.endpoint.health.probes.enabled=true for /health/liveness and /health/readiness.
- Group indicators via management.endpoint.health.group.* to match platform expectations.
- Implement custom indicators by extending HealthIndicator or ReactiveHealthContributor; sample implementations live in references/examples.md#custom-health-indicator.

### 4. Publish metrics and traces
- Activate Micrometer exporters (Prometheus, OTLP, Wavefront, StatsD) via management.metrics.export.*.
- Apply MeterRegistryCustomizer beans to add application, environment, and business tags for observability correlation.
- Surface HTTP request metrics with server.observation.* configuration when using Spring Boot 3.2+.

### 5. Enable diagnostics tooling
- Turn on /actuator/startup (Spring Boot 3.5+) and /actuator/conditions during incident response to inspect auto-configuration decisions.
- Register an HttpExchangeRepository (e.g., InMemoryHttpExchangeRepository) before enabling /actuator/httpexchanges for request auditing.
- Consult references/official-actuator-docs.md for endpoint behaviors and limits.

## 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 curl probes in CI/CD pipelines.

## Constraints
- Avoid exposing /actuator/env, /actuator/configprops, /actuator/logfile, and /actuator/heapdump on 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.

## Reference Materials
- [Endpoint quick reference](references/endpoint-reference.md)
- [Implementation examples](references/examples.md)
- [Official documentation extract](references/official-actuator-docs.md)
- [Auditing with Actuator](references/auditing.md)
- [Cloud Foundry integration](references/cloud-foundry.md)
- [Enabling Actuator features](references/enabling.md)
- [HTTP exchange recording](references/http-exchanges.md)
- [JMX exposure](references/jmx.md)
- [Monitoring and metrics](references/monitoring.md)
- [Logging configuration](references/loggers.md)
- [Metrics exporters](references/metrics.md)
- [Observability with Micrometer](references/observability.md)
- [Process and Monitoring](references/process-monitoring.md)
- [Tracing](references/tracing.md)
- Scripts directory (scripts/) reserved for future automation; no runtime dependencies today.

## Validation Checklist
- Confirm mvn spring-boot:run or ./gradlew bootRun exposes expected endpoints under /actuator (or custom base path).
- Verify /actuator/health/readiness returns UP with all mandatory components before promoting to production.
- Scrape /actuator/metrics or /actuator/prometheus to 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.

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/spring-boot-actuator/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-actuator/SKILL.md
  • Cursor: ~/.cursor/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-actuator/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-actuator/SKILL.md

πŸš€ Install with CLI:
npx skills add giuseppe-trisciuoglio/developer-kit

Read the Master Guide: Mastering Agent Skills β†’

Related Skill Units

Recommended Rules

View more rules β†’

Recommended Workflows

View more workflows β†’

Recommended MCP Servers

View more MCP servers β†’

Take It Further

Maximize your productivity with these powerful resources

πŸ“‹

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
πŸ“–

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid backend development issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Backend Development and is published by Giuseppe Trisciuoglio, maintained in giuseppe-trisciuoglio/developer-kit.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.