简体   繁体   中英

Spring Boot 2 health actuator default mapping

I'm using Spring Boot 2 M3 actuators. By default, the health endpoint is mapped to /application/health .

  • Is it possible to change this path to /health ?

FYI从Spring Boot 2.0.0开始.RELEASE默认的健康端点是/actuator/health

In your application.properties file add this to set the base path to '/'

management.endpoints.web.base-path=/

Path will now be '/health'

Edit: Alternatively if you are using YAML use:

management:
  endpoints:
    web:
      base-path: /

See this documentation for Spring Boot 2.0.0,

https://docs.spring.io/spring-boot/docs/2.0.0.M4/reference/htmlsingle/#production-ready-customizing-management-server-context-path

the property is,

management.context-path

I think this should work but cannot verify it right now. management.context-path=/

Yes, it is endpoints.health.path .

Update

Sorry, I understood like you want to change health to something else.

If you want change /application/health to /health, then you should use endpoints.jmx.domain . Or change path of your application to ROOT.

See

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM