Why this matters
- Kubernetes liveness and readiness probes need a reliable endpoint that returns 200 only when the app can actually handle requests.
- Custom health indicators let you surface BookStore-specific dependencies: database connectivity, Redis reachability, and payment gateway status.
- Metrics endpoints feed Prometheus and Grafana dashboards — request rates, error ratios, and JVM memory without writing instrumentation from scratch.
Actuator endpoints
L1 · Fresher/actuator/health reports liveness; orchestrators use it for probes. Expose only safe endpoints publicly.
Custom health indicators
L2 · IntermediateImplement HealthIndicator for BookStore dependencies — payment gateway, warehouse API, disk space.
Securing actuator
L3 · AdvancedRequire authentication or network policies for /actuator/* in production; never leave env and beans open on the internet.
Kubernetes probes
L4 · ExpertSeparate liveness (restart) from readiness (traffic) — readiness should fail when dependencies are down, not liveness.
Actuator endpoints you will use daily
/actuator/health— aggregated health with component breakdown (db,redis,diskSpace)./actuator/metrics— lists available Micrometer meters; append a name for current values./actuator/info— build metadata frominfo.*properties and customInfoContributorbeans./actuator/prometheus— scrape-friendly metrics export when the Prometheus registry is on the classpath.HealthIndicator— implement this interface to add custom checks to the health aggregate.
Add Actuator and expose endpoints
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: when_authorized
probes:
enabled: true # adds /actuator/health/liveness and /readiness
info:
env:
enabled: true
info:
app:
name: BookStore API
version: 2.4.1
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 3 sections
- Custom health for external dependencies
- Secure actuator in production
- Endpoints beyond health
Test yourself
Answer these before moving on — recall is what makes it stick.