Spring Boot Actuator

SkillCloud & infra

Spring Boot Actuator for monitoring and management. Covers health indicators, metrics with Micrometer, Prometheus integration, custom endpoints, Kubernetes probes, and endpoint security.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Spring Boot Actuator skill

What this skill tells your AI

The instructions your AI receives, as published by claude-dev-suite/claude-dev-suite in skills/backend-frameworks/spring-actuator/SKILL.md and read by ahel’s review.

Quick Start

<!-- pom.xml -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
# application.yml
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus
  endpoint:
    health:
      show-details: when_authorized
  info:
    env:
      enabled: true

info:
  app:
    name: @project.name@
    version: @project.version@

Endpoints Configuration

management:
  endpoints:
    web:
      exposure:
        include: "*"  # Dev: all
        # include: health,info,metrics,prometheus  # Prod
        exclude: shutdown,threaddump
      base-path: /actuator

  endpoint:
    health:
      enabled: true
      show-details: when_authorized
      show-components: when_authorized
    shutdown:
      enabled: false  # Dangerous in prod

Available Endpoints

EndpointDescriptionDefault
/healthHealth statusEnabled
/infoApp infoEnabled
/metricsMetricsEnabled
/prometheusPrometheus formatEnabled*
/envEnvironment propertiesDisabled
/configpropsConfiguration propertiesDisabled
/beansAll beansDisabled
/mappingsRequest mappingsDisabled
/loggersLogger levelsDisabled
/threaddumpThread dumpDisabled
/shutdownGraceful shutdownDisabled

Health Indicators

management:
  health:
    db:
      enabled: true
    redis:
      enabled: true
    diskspace:
      enabled: true
      threshold: 10MB

Custom Health Indicator

@Component
public class ExternalServiceHealthIndicator implements HealthIndicator {

    private final RestClient restClient;

    @Override
    public Health health() {
        try {
            long startTime = System.currentTimeMillis();
            ResponseEntity<Void> response = restClient.get()
                .uri("/health")
                .retrieve()
                .toBodilessEntity();
            long responseTime = System.currentTimeMillis() - startTime;

            if (response.getStatusCode().is2xxSuccessful()) {
                return Health.up()
                    .withDetail("service", "external-api")
                    .withDetail("responseTime", responseTime + "ms")
                    .build();
            }
            return Health.down().build();
        } catch (Exception e) {
            return Health.down()
                .withDetail("error", e.getMessage())
                .build();
        }
    }
}

Full Reference: See health.md for composite indicators, health groups, and availability management.


Kubernetes Probes

management:
  endpoint:
    health:
      probes:
        enabled: true
      group:
        liveness:
          include: livenessState
        readiness:
          include: readinessState,db,redis

  health:
    livenessstate:
      enabled: true
    readinessstate:
      enabled: true
# Kubernetes deployment
spec:
  containers:
    - name: app
      livenessProbe:
        httpGet:
          path: /actuator/health/liveness
          port: 8080
        initialDelaySeconds: 30
        periodSeconds: 10

      readinessProbe:
        httpGet:
          path: /actuator/health/readiness
          port: 8080
        initialDelaySeconds: 10
        periodSeconds: 5

Full Reference: See health.md for availability state management and K8s probe configuration.


Metrics with Micrometer

management:
  metrics:
    enable:
      all: true
    tags:
      application: ${spring.application.name}
      environment: ${spring.profiles.active:default}
    distribution:
      percentiles-histogram:
        http.server.requests: true

Custom Metrics

@Service
public class OrderService {

    private final MeterRegistry meterRegistry;
    private final Counter orderCounter;
    private final Timer orderProcessingTimer;

    public OrderService(MeterRegistry meterRegistry) {
        this.meterRegistry = meterRegistry;
        this.orderCounter = Counter.builder("orders.created")
            .description("Total orders created")
            .register(meterRegistry);
        this.orderProcessingTimer = Timer.builder("orders.processing.time")
            .publishPercentiles(0.5, 0.95, 0.99)
            .register(meterRegistry);
    }

    public Order createOrder(OrderRequest request) {
        return orderProcessingTimer.record(() -> {
            Order order = processOrder(request);
            orderCounter.increment();
            return order;
        });
    }
}

Full Reference: See metrics.md for annotations, Prometheus config, and Grafana alerts.


Prometheus Integration

management:
  endpoints:
    web:
      exposure:
        include: prometheus
  prometheus:
    metrics:
      export:
        enabled: true
# prometheus.yml
scrape_configs:
  - job_name: 'spring-boot-app'
    metrics_path: '/actuator/prometheus'
    scrape_interval: 15s
    static_configs:
      - targets: ['localhost:8080']

Security

@Configuration
@EnableWebSecurity
public class ActuatorSecurityConfig {

    @Bean
    public SecurityFilterChain actuatorSecurityFilterChain(HttpSecurity http) throws Exception {
        return http
            .securityMatcher(EndpointRequest.toAnyEndpoint())
            .authorizeHttpRequests(auth -> auth
                .requestMatchers(EndpointRequest.to("health", "info")).permitAll()
                .requestMatchers(EndpointRequest.to("prometheus")).permitAll()
                .requestMatchers(EndpointRequest.to("env", "beans")).hasRole("ADMIN")
                .anyRequest().authenticated()
            )
            .httpBasic(Customizer.withDefaults())
            .build();
    }
}
# Separate management port
management:
  server:
    port: 9090
    address: 127.0.0.1

Full Reference: See custom-endpoints.md for custom endpoints and testing.


Best Practices

DoDon't
Expose only necessary endpoints in prodExpose all endpoints
Use health groups for K8s probesUse single health endpoint
Configure metrics with consistent tagsUse high-cardinality tags
Implement custom health indicatorsRely only on built-in
Separate management port in productionUse same port as app

When NOT to Use This Skill

  • Application profiling - Use spring-profiles for environment config
  • Distributed tracing - Use micrometer-tracing for trace context
  • Log aggregation - Use logging frameworks and ELK/Loki
  • APM tools - Actuator complements Datadog, New Relic

Common Pitfalls

ErrorCauseSolution
Endpoints not exposedMissing configAdd to management.endpoints.web.exposure.include
Health always UPIndicators not configuredVerify dependencies in classpath
Metrics missingRegistry not configuredAdd micrometer-registry-prometheus
Security bypassEndpoints publicConfigure security for actuator
Memory leakHigh cardinality tagsAvoid userId, requestId as tags

Anti-Patterns

Anti-PatternProblemSolution
Exposing all endpoints in prodSecurity riskLimit to health, metrics, prometheus
High cardinality metric tagsMemory explosionUse bounded tag values
No auth on sensitive endpointsInformation leakConfigure Spring Security
Ignoring health groupsPoor K8s integrationUse liveness/readiness groups

Quick Troubleshooting

ProblemDiagnosticFix
Endpoints not exposedCheck configAdd to exposure.include
Health always DOWNCheck componentFix failing indicator
Metrics missingCheck registryAdd Micrometer dependency
401 on endpointsSecurity blockingConfigure actuator security
Prometheus not scrapingCheck pathVerify /actuator/prometheus

Production Checklist

  • Health endpoints configured
  • K8s probes (liveness, readiness) active
  • Prometheus scraping configured
  • Alert rules defined
  • Security on sensitive endpoints
  • Custom health indicators for external deps
  • Business metrics implemented
  • Grafana dashboard configured

Reference Files

FileContent
health.mdHealth Indicators, K8s Probes, Availability
metrics.mdMicrometer, Prometheus, Grafana Alerts
custom-endpoints.mdCustom Endpoints, Security, Testing

External Documentation

Signals

GitHub stars
33
Forks
6
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
spring-actuator
Source
github.com/claude-dev-suite/claude-dev-suite