spring-boot health not showing details (withDetail info)

后端 未结 7 1109
北荒
北荒 2020-12-29 20:13

I have written a class implementing HealthIndicator, overriding the health-method. I return Health.down().withDetail(\"SupportServiceStatus\", \"UP\").build();<

相关标签:
7条回答
  • 2020-12-29 20:48

    Thanks @rvit34 and @Ninja Code Monkey its working.

    For Springboot 2.x.x.RELEASE,

    Use below for application.properties,

    management.endpoint.health.show-details=ALWAYS

    Use below for applicaton.yml,

    management: endpoint: health: show-details: "ALWAYS"

    0 讨论(0)
  • 2020-12-29 20:56

    I had this same problem, on version Spring Boot 1.5.9 I had to set

    management.security.enabled=false
    
    0 讨论(0)
  • 2020-12-29 21:02

    At Spring Boot 2.0.0.RELEASE:

    management:
       endpoint:
          health:
            show-details: "ALWAYS"
    
    0 讨论(0)
  • 2020-12-29 21:04

    According to spring-boot docs:

    . . . by default, only the health status is exposed over an unauthenticated HTTP connection. If you are happy for complete health information to always be exposed you can set endpoints.health.sensitive to false.

    Solution is to set endpoints.health.sensitive to false in application.properties.

    application.properties

    endpoints.health.sensitive=false
    

    For >1.5.1 application.properties

    management.security.enabled=false 
    

    At Spring Boot 2.0.0.RELEASE (thx @rvit34 and @nisarg-panchal):

    management:
      endpoint:
        health:
          show-details: "ALWAYS"
      endpoints:
        web:
          exposure:
            include: *
    

    management.endpoints.web.exposure.include=* exposes all endpoints, if that is what you want.

    Current documentation can be found here: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html

    0 讨论(0)
  • 2020-12-29 21:04

    need to add

    management.endpoint.health.show-details=always
    

    to Application.properties

    0 讨论(0)
  • 2020-12-29 21:10

    For Spring boot 2.X I have following in my application.properties file for detailed information:

    management.endpoints.web.exposure.include=*
    management.endpoint.health.show-details=ALWAYS
    
    0 讨论(0)
提交回复
热议问题