Spring Boot: Writing Custom Health Indicators
Spring Boot: Writing Custom Health Indicators

Spring Boot: Writing Custom Health Indicators

Author
Shiv Bade
Tags
spring boot
health checks
Published
January 14, 2016
Featured
Slug
Tweet
Spring Boot lets you expose custom health checks using HealthIndicator.
Sample:
@Component public class QueueHealthIndicator implements HealthIndicator { public Health health() { if (queue.isAvailable()) { return Health.up().build(); } else { return Health.down().withDetail("queue", "Unavailable").build(); } } }
Useful for circuit breakers, dashboards, and alerts.