Spring Boot 2.0 Not Registering Custom Actuator Endpoint

前端 未结 3 823
梦如初夏
梦如初夏 2021-01-20 06:15

I\'ve recently upgraded a project from Spring Boot 1.5.1 to 2.0.0 and our custom actuator endpoint is not getting registered. I\'ve tried the following endpoint migration gu

相关标签:
3条回答
  • 2021-01-20 06:57

    I believe, the answer by Sharan De Silva is not correct. I just spent several hours on a identical issue, because the property name is different. Should be:

    management:
      endpoints:
        web:
          exposure:
            include: 'health,info,metrics,customendpoint'
    

    Here's the official reference: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html#production-ready-endpoints-exposing-endpoints

    0 讨论(0)
  • 2021-01-20 06:59

    management.endpoints.web.exposure.include={ENDPOINT-NAME}

    0 讨论(0)
  • 2021-01-20 07:11

    You need to expose your custom endpoint by adding this to your application.yml file.

    management:
      endpoints:
        web:
          expose: 'customendpoint,info,health'
          exclude: env
    

    If you want to expose all your endpoints then change it as expose: '*'

    0 讨论(0)
提交回复
热议问题