我正在使用 spring 启动2.0.0.M3与 spring 启动器 - 启动器 - Actuator . 我启用了两项 Health 检查:
management.health.diskspace.enabled=true
management.health.mongo.enabled=true
Health 检查bean由自动配置创建,但不是 HealthMvcEndpoint
. localhost:8080/health
的回复是404 .
我做错了什么?
提前致谢
编辑:
Mhm Actuator 项目是否与反应和webflux一起工作?好的发现了这个问题:https://github.com/spring-projects/spring-boot/issues/7970
3 回答
根据2.0.0M的文件, Actuator endpoints 的前缀为
/application
,因此它们变为/application/health
.在启动应用程序时,您还应该能够在
info
日志中查看有关 endpoints 的所有信息https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints
还有一个关于它的实际发行说明:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-M1-Release-Notes#actuator-default-mapping
我正在使用webflux springboot 2.0.2.RELEASE . 检查日志我发现它现在位于/ Actuator 下面 .
所以:
http://localhost:8080/actuator/health
会起作用将其添加到您的application.properties文件中:
Actuator endpoints 现在将是'/ health'