Spring boot 2.1.3 remove extra 'details' field from health endpoint result

爷,独闯天下 提交于 2019-12-11 17:09:49

问题


I am porting my service from Spring 1.5 to 2.1.3 and I noticed that after making necessary changes my health endpoint which adds some custom data is returning the JSON with an extra 'details' tag. Is there any way to get rid of it?

Spring 2.1.3

{
"status": "UP",
"details": { 
    "diskSpace": {
        "status": "UP",
        "details": {
            "stats": [
                {
                    "status": "UP",
                    "totalSpace": 64412954624
                }
            ]
        }
    }
}

basic health endpoint without my change:

 {
  "status": "UP",
  "details": {
    "application": {
        "status": "UP"
    }
  }
}

Spring 1.5

{
 "status": "UP",
 "diskSpace": {
    "status": "UP",
    "stats": [
          {
             "status": "UP",
             "totalSpace": 64412954624
          }
       ]
   }
}

basic health endpoint:

{
  "status": "UP",
  "application": {
    "status": "UP"
  }
}

There was no 'details' specifically. I tried this and it does not help - Spring Boot remove extra HealthIndicator information

Note: I have also customized my DiskSpaceHealthIndicator.

Any suggestion is greatly appreciated.

来源:https://stackoverflow.com/questions/57703224/spring-boot-2-1-3-remove-extra-details-field-from-health-endpoint-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!