Spring boot actuator "/health" is not working

Kaushik Lele picture Kaushik Lele · Jun 20, 2017 · Viewed 13.8k times · Source

I have a running Springboot application which serves the URL http://localhost:8081/topics and returns me JSON response as expected.

I added actuator dependency <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <scope>test</scope> </dependency>

as suggested in tutorial

But when I hit http://localhost:8081/health it does not give expected result. It says

{ "timestamp": 1497952368055, "status": 404, "error": "Not Found", "message": "No message available", "path": "/health" }

Spring boot version is 1.5.4.RELEASE. And Java 1.8 What additional settings do I need to do ?

Answer

samivic picture samivic · Nov 9, 2018

In Spring Boot 2.0.0 you have to use /actuator/health and in the application.properties file add the following line:

management.endpoint.health.show-details=always