Health checks: liveness vs readiness
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
expose and use the two health signals.
Planned topics
- Liveness asks: "is the process stuck and in need of a restart?"
- Readiness asks: "can the app take traffic now?" (for example, the database is reachable).
- Spring Boot Actuator exposes
/actuator/health/livenessand/actuator/health/readiness(enable the probes; verify properties for your version). - Do not check the database in liveness: a database outage would restart healthy apps and make things worse.
- Expose only the health endpoint publicly; keep other actuator endpoints private.
Draft outline details
Demonstration
management:
endpoint.health.probes.enabled: true
endpoints.web.exposure.include: healthCheck your understanding
Which probe should fail when the database is down?
Show answer
Readiness.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.