3
votes

i'm using spring boot 2.0.0.M3 with the spring-boot-starter-actuator. I enabled two health checks:

management.health.diskspace.enabled=true
management.health.mongo.enabled=true

The healt check beans are created by the auto configure, but not the HealthMvcEndpoint. The response of localhost:8080/health is 404.

What did I do wrong?

Thanks in advance

EDIT:

Mhm do the actuator project works with reactive and webflux? Ok found this issue: https://github.com/spring-projects/spring-boot/issues/7970

4

4 Answers

1
votes

according to the documentations for 2.0.0M the actuator endpoints have been prefixed with /application so they become /application/health instead.

You should also be able to see all this in the info logs about the endpoints, when booting up your application

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints

also an actual release note about it: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-M1-Release-Notes#actuator-default-mapping

1
votes

I'm using webflux+springboot 2.0.2.RELEASE. Checking the logs I found that it is actuallu under /actuator now.

so: http://localhost:8080/actuator/health will work

0
votes

Add this to your application.properties file:

management.endpoints.web.base-path=/

The actuator endpoints will now be '/health'

0
votes

Include the spring-boot-starter-web dependency in your pom.xml:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>