К основному содержанию
скилл CX Codex

spring-boot-actuator — скилл для Claude Code: обзор и установка

Скилл помогает настроить Spring Boot Actuator: добавить пробы жизнеспособности для оркестраторов, защитить служебные эндпоинты и экспортировать метрики Micrometer в Prometheus.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-actuator -a claude-code
Открыть на GitHub

Что делает spring-boot-actuator

Скилл содержит инструкции по внедрению Spring Boot Actuator в сервисы на базе JVM. Агент добавляет зависимость в Maven или Gradle и выстраивает группы проб /health/liveness и /health/readiness. Это упрощает запуск приложения в кластере.

Внутри собраны правила изоляции служебного трафика через SecurityFilterChain и перенос Actuator на отдельный порт management.server.port. Скилл также помогает подключить экспорт метрик в Prometheus через Micrometer и настроить аудит через HttpExchangeRepository. Для трассировки запросов в Spring Boot 3.2+ настраивается server.observation.

Если открыть эндпоинты вроде /actuator/env или /actuator/heapdump наружу без авторизации, проект сразу получит критическую брешь в безопасности. Скилл прямо требует закрывать их от публичной сети. Отдельно задан лимит на кастомные индикаторы здоровья: они не должны блокировать потоки или отвечать дольше 250 ms.

Какие задачи решает

  • настроить пробы liveness и readiness для оркестратора
  • вынести служебные эндпоинты на отдельный порт и закрыть авторизацией
  • подключить сбор и экспорт метрик приложения в Prometheus
  • включить аудит HTTP-запросов через HttpExchangeRepository

Примеры запросов агенту

  • Настрой в Spring Boot эндпоинты liveness и readiness для проверки здоровья в Kubernetes
  • Вынеси Actuator на отдельный порт 9091 и закрой эндпоинты через SecurityFilterChain
  • Подключи экспорт метрик в Prometheus через Micrometer и добавь теги окружения

Как установить spring-boot-actuator

1Через Skills CLI (Vercel)

npx skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-actuator -a claude-code

2Вручную: положить файлы

~/.claude/skills/spring-boot-actuator/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/spring-boot-actuator/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о spring-boot-actuator

Как установить spring-boot-actuator в Claude Code?

Выполните в терминале команду npx skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-actuator -a claude-code. После этого скилл станет доступен в Claude Code.

Что делает скилл spring-boot-actuator?

Он предоставляет агенту готовые шаблоны конфигурации для Spring Boot Actuator. Скилл помогает настроить системные эндпоинты, пробы жизнеспособности, безопасность через Spring Security и экспорт метрик в Prometheus.

Какие эндпоинты Actuator нельзя открывать в публичный доступ?

Скилл предостерегает от публикации эндпоинтов /actuator/env, /actuator/configprops, /actuator/logfile и /actuator/heapdump без аутентификации. Доступ к ним необходимо ограничивать сетевыми правилами или авторизацией.

Исходный текст

SKILL.md · MIT
---
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
```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"
}
```
After adding the dependency, verify endpoints respond:
```bash
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/health` and `/actuator/info` respond with `200 OK`.

### 2. Expose 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`.
> **Validate**: `curl http://localhost:8080/actuator` returns the list of exposed endpoints.

### 3. 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.
> **Validate**: Unauthenticated requests to protected endpoints return `401 Unauthorized`.

### 4. 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 in `references/examples.md#custom-health-indicator`.
> **Validate**: `/actuator/health/readiness` returns `UP` with all mandatory components before promoting to production.

### 5. 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+.
> **Validate**: Scrape `/actuator/prometheus` and 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/conditions` during incident response to inspect auto-configuration decisions.
- Register an `HttpExchangeRepository` (e.g., `InMemoryHttpExchangeRepository`) before enabling `/actuator/httpexchanges` for request auditing.
- Consult `references/endpoint-reference.md` for endpoint behaviors and limits.
> **Validate**: `/actuator/startup` and `/actuator/conditions` return valid JSON payloads.

## Examples

### Basic – Expose health and info safely
```yaml
management:
  endpoints:
    web:
      exposure:
        include: "health,info"
  endpoint:
    health:
      show-details: never
```

### Intermediate – 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: always
```

### Advanced – 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.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 and Warnings
- 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.
- 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/beans` and `/actuator/mappings` as they reveal internal application structure.

## Reference Materials
- [Endpoint quick reference](references/endpoint-reference.md)
- [Implementation examples](references/examples.md)
- [Official documentation extract](references/endpoint-reference.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.

© giuseppe-trisciuoglio · MIT · giuseppe-trisciuoglio/developer-kit

Похожие скиллы

Всё по теме «Бэкенд и API» →
java-spring-boot pluginagentmarketplace Скилл помогает создавать бэкенд на Spring Boot 3: настраивать REST API, аутентификацию через Spring Security, доступ к базам через Spring Data и мониторинг Actuator. CX Codex +1 11 800установок spring-boot-engineer https://github.com/Jeffallan Разворачивает архитектуру Spring Boot 3.x, контроллеры, репозитории Spring Data JPA и правила Spring Security 6. Пригодится при сборке REST API, реактивных сервисов и микросервисов на Java. CX Codex +1 8 400установок create-spring-boot-java-project официальный github Создаёт каркас Spring Boot на Java с Maven, базами данных и Docker Compose. Подходит для старта API, которому нужны PostgreSQL, Redis и MongoDB. 9 516установок spring-boot Mindrally Скилл задаёт агенту стиль кода на Spring Boot: REST-контроллеры, тесты, безопасность, сборка и деплой. Пригодится, когда проект на Java и хочется единообразия. CX Codex +1 832установок spring-boot-development manutej Скилл для ИИ-агента, который подсказывает, как писать Spring Boot: авто-конфигурация, внедрение зависимостей, REST-контроллеры, Spring Data и Spring Security. CX Codex +1 534установок 302-frameworks-spring-boot-rest Juan Antonio Breña Moral Скилл для проектирования и разбора REST API на Spring Boot: методы, коды ответов, DTO, версионирование, пагинация, ошибки по RFC 7807. CX Codex +1 392установок

Из того же набора93

nextjs-authentication Скилл даёт готовые шаблоны аутентификации для Next.js 15+ App Router на Auth.js 5: провайдеры, защита маршрутов, сессии и роли. CX Codex +1 3 800установок spring-boot-dependency-injection Скилл внедряет паттерны внедрения зависимостей через конструктор в Spring Boot. Он помогает избавиться от field injection и настроить выбор бинов через @Primary и @Qualifier. CX Codex +1 3 800установок nextjs-code-review Проверяет код Next.js перед слиянием изменений: компоненты, серверные действия, кэш и маршруты. Пригодится после новой функции или миграции. CX Codex +1 3 800установок unit-test-wiremock-rest-api Скилл задаёт шаблоны юнит-тестов внешних REST API на WireMock: заглушки ответов, проверка запросов, имитация сбоев без реальной сети. CX Codex +1 3 800установок spring-ai-mcp-server-patterns Скилл с шаблонами MCP-серверов на Spring Boot и Spring AI: инструменты через @Tool, промпт-шаблоны, транспорты stdio, HTTP и SSE. CX Codex +1 3 800установок nestjs-code-review Скилл для ревью NestJS-приложений: проверяет контроллеры, сервисы, модули, DI, гарды и работу с базой. Пригодится перед мержем пул-реквеста. CX Codex +1 3 800установок spring-boot-resilience4j Скилл добавляет паттерны отказоустойчивости Resilience4j в Spring Boot 3.x. Он помогает настроить размыкатели цепи и повторные вызовы при сбоях внешних сервисов. CX Codex +1 3 800установок unit-test-service-layer Скилл задаёт агенту шаблон юнит-тестов сервисного слоя на Mockito: моки репозиториев, проверка вызовов, сценарии с исключениями. CX Codex +1 3 800установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой