spring-boot-actuator by giuseppe-trisciuoglio/developer-kit
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill spring-boot-actuatorreferences/ 目录。// Gradle dependencies { implementation "org.springframework.boot:spring-boot-starter-actuator" }
添加依赖后,验证端点是否响应:
curl http://localhost:8080/actuator/health curl http://localhost:8080/actuator/info
在您的构建配置中包含 spring-boot-starter-actuator。
:重启服务并确认 和 返回 。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
/actuator/health/actuator/info200 OKmanagement.endpoints.web.exposure.include 设置为精确的端点列表,对于内部部署可以使用 "*"。/actuator 与路由冲突时,调整 management.endpoints.web.base-path(例如,/management)。references/endpoint-reference.md 中查看详细的端点语义。验证:
curl http://localhost:8080/actuator返回已暴露端点的列表。
EndpointRequest.toAnyEndpoint() 和基于角色的规则,应用独立的 SecurityFilterChain。management.server.port 与防火墙控制或服务网格策略,实现仅限操作员访问。/actuator/health/** 可公开访问;否则强制执行身份验证。验证:对受保护端点的未经验证的请求返回
401 Unauthorized。
management.endpoint.health.probes.enabled=true 以支持 /health/liveness 和 /health/readiness。management.endpoint.health.group.* 对指标进行分组,以符合平台期望。HealthIndicator 或 ReactiveHealthContributor 实现自定义指标;示例实现见 references/examples.md#custom-health-indicator。验证:在投入生产之前,
/actuator/health/readiness返回UP状态且包含所有必需组件。
management.metrics.export.* 激活 Micrometer 导出器(Prometheus、OTLP、Wavefront、StatsD)。MeterRegistryCustomizer bean 来添加 application、environment 和业务标签,以便进行可观测性关联。server.observation.* 配置展示 HTTP 请求指标。验证:抓取
/actuator/prometheus并确认所需的计量器(http.server.requests、jvm.memory.used)存在。
/actuator/startup(Spring Boot 3.5+)和 /actuator/conditions 以检查自动配置决策。/actuator/httpexchanges 进行请求审计之前,注册一个 HttpExchangeRepository(例如,InMemoryHttpExchangeRepository)。references/endpoint-reference.md 了解端点行为和限制。验证:
/actuator/startup和/actuator/conditions返回有效的 JSON 负载。
management: endpoints: web: exposure: include: "health,info" endpoint: health: show-details: never
@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
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();
}
}
更多端到端示例可在 references/examples.md 中找到。
references/ 目录存放详细文档以节省上下文空间。curl 探针脚本来自动化回归检查。/actuator/env、/actuator/configprops、/actuator/logfile 和 /actuator/heapdump。/actuator/beans 和 /actuator/mappings,因为它们会暴露应用程序的内部结构。scripts/) 保留用于未来自动化;目前没有运行时依赖。mvn spring-boot:run 或 ./gradlew bootRun 在 /actuator(或自定义基础路径)下暴露了预期的端点。/actuator/health/readiness 返回 UP 状态且包含所有必需组件。/actuator/metrics 或 /actuator/prometheus 以确保所需的计量器(http.server.requests、jvm.memory.used)存在。每周安装次数
357
代码仓库
GitHub 星标数
174
首次出现
2026年2月3日
安全审计
安装于
claude-code276
gemini-cli272
opencode271
codex267
cursor266
github-copilot252
references/.<!-- 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
Include spring-boot-starter-actuator in your build configuration.
Validate : Restart the service and confirm
/actuator/healthand/actuator/inforespond with200 OK.
management.endpoints.web.exposure.include to the precise list or "*" for internal deployments.management.endpoints.web.base-path (e.g., /management) when the default /actuator conflicts with routing.references/endpoint-reference.md.Validate :
curl http://localhost:8080/actuatorreturns the list of exposed endpoints.
SecurityFilterChain using EndpointRequest.toAnyEndpoint() with role-based rules.management.server.port with firewall controls or service mesh policies for operator-only access./actuator/health/** publicly accessible only when required; otherwise enforce authentication.Validate : Unauthenticated requests to protected endpoints return
401 Unauthorized.
management.endpoint.health.probes.enabled=true for /health/liveness and /health/readiness.management.endpoint.health.group.* to match platform expectations.HealthIndicator or ReactiveHealthContributor; sample implementations in references/examples.md#custom-health-indicator.Validate :
/actuator/health/readinessreturnsUPwith all mandatory components before promoting to production.
management.metrics.export.*.MeterRegistryCustomizer beans to add application, environment, and business tags for observability correlation.server.observation.* configuration when using Spring Boot 3.2+.Validate : Scrape
/actuator/prometheusand confirm required meters (http.server.requests,jvm.memory.used) are present.
/actuator/startup (Spring Boot 3.5+) and /actuator/conditions during incident response to inspect auto-configuration decisions.HttpExchangeRepository (e.g., InMemoryHttpExchangeRepository) before enabling /actuator/httpexchanges for request auditing.references/endpoint-reference.md for endpoint behaviors and limits.Validate :
/actuator/startupand/actuator/conditionsreturn valid JSON payloads.
management:
endpoints:
web:
exposure:
include: "health,info"
endpoint:
health:
show-details: never
@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
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.
references/ for verbose documentation to conserve context.curl probes in CI/CD pipelines./actuator/env, /actuator/configprops, /actuator/logfile, and /actuator/heapdump on public networks./actuator/beans and /actuator/mappings as they reveal internal application structure.mvn spring-boot:run or ./gradlew bootRun exposes expected endpoints under /actuator (or custom base path)./actuator/health/readiness returns UP with all mandatory components before promoting to production./actuator/metrics or /actuator/prometheus to ensure required meters (http.server.requests, jvm.memory.used) are present.Weekly Installs
357
Repository
GitHub Stars
174
First Seen
Feb 3, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code276
gemini-cli272
opencode271
codex267
cursor266
github-copilot252
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
68,100 周安装
Mole Mac 清理工具 - macOS 系统优化与磁盘空间管理 CLI 工具
263 周安装
React Three Fiber 后期处理教程:Bloom辉光、Vignette暗角等效果实现
263 周安装
React-PDF 使用指南:在 React 中生成 PDF 的完整教程与最佳实践
263 周安装
Legal Advisor - Claude AI 法律顾问技能,智能法律咨询与文档分析助手
263 周安装
飞书CLI工具箱:13个功能模块命令速查,高效管理电子表格、日历、任务、文件等
263 周安装
PARA第二大脑技能:AI助手帮你用PARA方法组织知识库和数字笔记
263 周安装
scripts/) reserved for future automation; no runtime dependencies today.