Boni García
Boni García

Reputation: 4868

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.

Upvotes: 12

Views: 22328

Answers (4)

Sophia Price
Sophia Price

Reputation: 978

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: /

Upvotes: 19

Taylor Gautier
Taylor Gautier

Reputation: 4944

FYI as of Spring Boot 2.0.0.RELEASE the default health endpoint is /actuator/health

Upvotes: 12

Darren Forsythe
Darren Forsythe

Reputation: 11411

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=/

Upvotes: 5

egorlitvinenko
egorlitvinenko

Reputation: 2776

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

Upvotes: 0

Related Questions