在Spring Boot 2.0.0.RELEASE之后,所有端点默认的前缀是/actuator
,所以如果想检查应用的健康状态,应该访问/actuator/health
而非/health
。
为了通过HTTP能够访问端点,需要暴露相应的端点。
默认情况下:
- 只有
/health
和/info
是暴露可访问的, - 只有
/shutdown
是默认关闭的。
通过在application.properties
中做如下配置可以暴露所有端点:
management.endpoints.web.exposure.include=*