nanosoft
nanosoft

Reputation: 3091

Health endpoint not working in spring-boot-actuator service

Hi I am using spring boot version - 2.0.0.RC1. I have simple service running @port 9400.

My application.properties have below configuration:

spring.main.banner-mode = CONSOLE
spring.profiles.active  = ${profile:local}

server.compression.enabled = true
server.compression.min-response-size = 1
server.compression.mime-types = application/json,application/xml,text/xml,text/plain

banner.charset              = UTF-8

management.endpoints.health.show-details=true
management.server.address: 127.0.0.1
management.endpoints.web.expose: health,info,metrics,mappings,trace
management.endpoints.health.show-details: true
management.endpoints.health.time-to-live: 2000
management.security.enabled: false
management.health.defaults.enabled: false
management.health.diskspace.enabled: true

My build.gradle has :

dependencies {
    // Spring Boot
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: springBootVersion
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: springBootVersion
}

My gradle.properties:

springBootVersion    = 2.0.0.RC1

When I point to http://127.0.0.1:9400/health

I get error screen as attached snapshot.

What am I missing?enter image description here

Upvotes: 2

Views: 10864

Answers (2)

KayV
KayV

Reputation: 13835

Just add the following property in application.properties file:

management.health.defaults.enabled=false

Upvotes: 0

The show-details value that you are providing is not a valid one... Anyway, in Spring Boot 2.0 the actuator endpoints (like the health) are remapped to /actuator/*. Now, the health is located at /actuator/health.

More info at the release notes in https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-RC2-Release-Notes#health-endpoint

Upvotes: 3

Related Questions