<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
这将为您的应用程序添加几个有用的端点。其中一个是/health。当您启动应用程序并导航到/health端点时,您将看到它已经返回了一些数据。
{
"status":"UP",
"diskSpace": {
"status":"UP",
"free":56443746,
"threshold":1345660
}
}
如何在Spring Boot Health中添加自定义健康检查?
management.endpoint.health.group.readiness.include="custom,readinessState"
。 - 袁文涛