Recall & Review
beginner
What is the purpose of health checks in a NestJS application using Terminus?
Health checks help monitor if the application and its dependencies are working correctly. Terminus provides easy ways to create these checks so the system can report its status.
Click to reveal answer
beginner
How do you add a simple HTTP health check endpoint using Terminus in NestJS?
You create a controller with the @HealthCheck() decorator and use the HealthCheckService to run built-in checks like HTTP or database checks. This endpoint returns the status of the app.
Click to reveal answer
intermediate
What is a 'readiness' health check and why is it important?
A readiness check tells if the app is ready to handle requests. It usually checks if dependencies like databases are connected. This helps load balancers send traffic only to ready instances.
Click to reveal answer
intermediate
Explain how Terminus integrates with NestJS dependency injection for custom health indicators.
You create a custom health indicator class that extends HealthIndicator. Then you inject it into your health controller to include custom checks in the health endpoint.Click to reveal answer
intermediate
What is the difference between liveness and readiness probes in Terminus health checks?
Liveness probes check if the app is alive (not stuck or crashed). Readiness probes check if the app is ready to serve traffic (all dependencies are working). Both help Kubernetes manage app lifecycle.
Click to reveal answer
Which decorator is used to mark a health check endpoint in NestJS Terminus?
✗ Incorrect
The @HealthCheck() decorator marks a method as a health check endpoint in Terminus.
What does a readiness probe typically check?
✗ Incorrect
Readiness probes check if dependencies like databases are connected and the app can serve traffic.
How do you add a custom health check in Terminus?
✗ Incorrect
You create a custom HealthIndicator class implementing HealthIndicator interface and inject it into the health controller.
Which service runs the health checks in a Terminus controller?
✗ Incorrect
HealthCheckService runs the registered health indicators and returns the combined status.
What HTTP status code does a healthy Terminus endpoint usually return?
✗ Incorrect
A healthy status returns HTTP 200 OK to indicate the app is working properly.
Describe how you would implement a basic health check endpoint in a NestJS app using Terminus.
Think about the steps from module setup to controller method.
You got /5 concepts.
Explain the difference between liveness and readiness probes and why both are useful in a cloud environment.
Consider how Kubernetes uses these probes.
You got /4 concepts.