MelleD
MelleD

Reputation: 791

Spring Boot 2 with actuator

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

Upvotes: 3

Views: 3213

Answers (4)

jordiburgos
jordiburgos

Reputation: 6302

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

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

Upvotes: 0

Sophia Price
Sophia Price

Reputation: 958

Add this to your application.properties file:

management.endpoints.web.base-path=/

The actuator endpoints will now be '/health'

Upvotes: 0

Emad Elagouz
Emad Elagouz

Reputation: 21

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

Upvotes: 1

Martin Hansen
Martin Hansen

Reputation: 2101

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

Upvotes: 1

Related Questions