Health checks — Microservices · NestJS

Tell an orchestrator whether the gateway is alive and whether it is ready: a liveness check that asks nothing, and a readiness check with Terminus that pings the cats service over TCP, the vet clinic over HTTP, and the shelter's kennels through an indicator of your own that can be up, degraded or down.

What you will learn

Read the theory for Health checks

All Microservices lessons

All NestJS courses

loading types…

What you'll learn

  • Tell liveness from readiness: whether to restart a process, and whether to send it traffic
  • Build health checks with TerminusModule, HealthCheckService.check() and @HealthCheck(), and read the result: status, info, error, details
  • Check dependencies with the built-in indicators: a microservice over its transport, an HTTP service by URL
  • Write an indicator of your own with HealthIndicatorService: up, degraded or down, with the data an operator needs