Reputation: 2101
I have written a class implementing HealthIndicator, overriding the health-method. I return Health.down().withDetail("SupportServiceStatus", "UP").build();
This should make my health
-endpoint return:
{
"status":"UP",
"applicationHealth": {
"status":"UP"
}
}
Instead it just returns (health, without details):
{
"status":"UP",
}
Javacode (somewhat simplified):
@Component
public class ApplicationHealth implements HealthIndicator {
@Override
public Health health() {
return check();
}
private Health check() {
return Health.up().withDetail("SupportServiceStatus", supportServiceStatusCode).build();
}
}
Upvotes: 43
Views: 58431
Reputation: 23
For Spring
version greater than 3X,
try calling
http://localhost:8081/actuator
instead of
http://localhost:8081/actuator/health
Upvotes: 0
Reputation: 2101
According to spring-boot docs:
. . . by default, only the health status is exposed over an unauthenticated HTTP connection. If you are happy for complete health information to always be exposed you can set
endpoints.health.sensitive
tofalse
.
Solution is to set endpoints.health.sensitive
to false
in application.properties
.
application.properties
endpoints.health.sensitive=false
For >1.5.1 application.properties
management.security.enabled=false
At Spring Boot 2.0.0.RELEASE (thx @rvit34
and @nisarg-panchal
):
management:
endpoint:
health:
show-details: "ALWAYS"
endpoints:
web:
exposure:
include: "*"
management.endpoints.web.exposure.include=*
exposes all endpoints, if that is what you want.
Current documentation can be found here: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html
Upvotes: 69
Reputation: 717
need to add
management.endpoint.health.show-details=always
to Application.properties
Upvotes: 3
Reputation: 131
For Spring boot 2.X I have following in my application.properties file for detailed information:
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=ALWAYS
Upvotes: 3
Reputation: 91
Thanks @rvit34 and @Ninja Code Monkey its working.
For Springboot 2.x.x.RELEASE,
Use below for application.properties,
management.endpoint.health.show-details=ALWAYS
Use below for applicaton.yml,
management:
endpoint:
health:
show-details: "ALWAYS"
Upvotes: 9
Reputation: 69
I had this same problem, on version Spring Boot 1.5.9 I had to set
management.security.enabled=false
Upvotes: 0
Reputation: 2116
At Spring Boot 2.0.0.RELEASE:
management:
endpoint:
health:
show-details: "ALWAYS"
Upvotes: 20
Reputation: 216
Setting 'endpoints.health.sensitive' made no difference... had to set:
management:
security:
enabled: false
Upvotes: 7