我们在为Spring Boot应用添加actuator后,期望的health接口返回结果应该是类似下面的结果:
{
-
status: "UP",
-
diskSpace: {
-
status: "UP",
-
total: 250182889472,
-
free: 31169568768,
-
threshold: 10485760
-
-
db: {
-
status: "UP",
-
database: "H2",
-
hello: 1
-
如果只是返回了status
{
-
status: "UP"
则需要为应用新增配置,以yml配置文件为例,需要添加如下配置:
management: security: enabled: false endpoints: health: sensitive: false