在 Spring Boot 中,使用 Actuator 来监控和管理应用程序的健康状态是一种常见的做法。Actuator 提供了多种端点(endpoints),例如 /health,用于报告应用程序的健康状态。如果需要自定义或重写 Actuator 的 /health 端点,使用 HealthIndicator可以实现这一目标。
1 | import org.springframework.boot.actuate.health.Health; |
在 Spring Boot 中,使用 Actuator 来监控和管理应用程序的健康状态是一种常见的做法。Actuator 提供了多种端点(endpoints),例如 /health,用于报告应用程序的健康状态。如果需要自定义或重写 Actuator 的 /health 端点,使用 HealthIndicator可以实现这一目标。
1 | import org.springframework.boot.actuate.health.Health; |