feat(obs): huijing-server 接 actuator + micrometer-registry-prometheus 激活 /actuator/prometheus(阶段四观测 波② T2-2)
单体聚合层(部署件)显式引入 spring-boot-starter-actuator + micrometer-registry-prometheus
(二者在 huijing-spring-boot-starter-monitor 里 optional 未随传递装入),wire 通「在席但残缺」的指标能力:
- /actuator/prometheus 端点成立、真出 JVM/HTTP/Tomcat 指标(供 mini-infra Collector/Prometheus 抓)
- HuijingMetricsAutoConfiguration 激活、aigc 的 SAA 图节点 ObservationRegistry 由 NOOP 转真(可产节点 span)
- /actuator/health 由假 {"code":404} 变真 Actuator HealthEndpoint
exposure 内网口径收敛为 health,prometheus(dev/local/staging 三 profile),不裸暴露 env/heapdump 等敏感端点。
不改 yudao 框架层 starter 的 optional 默认、不碰业务逻辑;版本由 spring-boot-dependencies BOM(3.5.14) 管。
验证:JDK17 下 mvn clean install -pl huijing-server -am -DskipTests 绿;repackaged jar 已含
spring-boot-actuator-3.5.14 + micrometer-registry-prometheus-1.15.11。
OTel java-agent 挂载属启动/部署项(T2-1),代码侧零改动,不在本 commit。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9f42cd2c7b
commit
7cdb3049eb
@ -212,6 +212,23 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- 观测接入(阶段四观测 波② · T2-2):激活 monitor starter 里「在席但残缺」的指标能力。
|
||||
huijing-spring-boot-starter-monitor 经 system-server / infra-server 两模块传递进本单体,但它未声明
|
||||
spring-boot-starter-actuator、且把 micrometer-registry-prometheus 标成 optional=true 不随传递装入,导致三处哑火:
|
||||
① /actuator/prometheus 端点不成立(无 PrometheusMeterRegistry);
|
||||
② HuijingMetricsAutoConfiguration 的 @ConditionalOnClass(MeterRegistryCustomizer) 因缺 actuator-autoconfigure 不激活;
|
||||
③ aigc 的 SAA 图节点 ObservationRegistry 退化为 NOOP、产不出节点 span。
|
||||
在单体聚合层(部署件)显式引入二者即 wire 通,不改 yudao 框架层 starter 的 optional 默认(框架层保持零副作用)。
|
||||
版本由 spring-boot-dependencies BOM(3.5.14) 统一管理,无需声明。 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 服务保障相关 -->
|
||||
<dependency>
|
||||
<groupId>com.wanxiang</groupId>
|
||||
|
||||
@ -104,7 +104,9 @@ management:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
# 阶段四观测 波② T2-2:内网口径收敛,仅暴露 health(探活/可用性)与 prometheus(供 Collector/Prometheus 抓指标);
|
||||
# 不裸暴露 env/heapdump/beans 等敏感端点(设计「最小暴露」纪律)。
|
||||
include: health,prometheus
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
|
||||
@ -123,7 +123,9 @@ management:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
# 阶段四观测 波② T2-2:内网口径收敛,仅暴露 health(探活/可用性)与 prometheus(供 Collector/Prometheus 抓指标);
|
||||
# 不裸暴露 env/heapdump/beans 等敏感端点(设计「最小暴露」纪律)。
|
||||
include: health,prometheus
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
|
||||
@ -117,7 +117,9 @@ management:
|
||||
web:
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
include: "*"
|
||||
# 阶段四观测 波② T2-2:内网口径收敛,仅暴露 health 与 prometheus。
|
||||
# staging 已在 huijing.security.permit-all-urls 放行 /actuator/**,可无鉴权探活/抓取。
|
||||
include: health,prometheus
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user