Health Checks
100%

Deployment · Lesson 4

Health Checks

Learn to combine a process check, a service check, and a client request after deployment.

A newly started program can be running before it is ready. Check the service in stages so a single passing indicator has a clear meaning.

Checking the Process

A container list can show that the main program is running. That answers an important first question for a new deployment. It cannot tell you whether the program finished initializing or whether a browser can reach it.

The new container shows Up. Which conclusion is supported?

Checking a Service Endpoint

An endpoint is an address and path the service handles. Check a path that matches the behavior you care about. To try this locally, use an empty practice folder. The redirection writes the version file. Leave the Python server running on loopback in this terminal and stop it with Ctrl+C after practice.

$ mkdir site
$ printf '%s\n' 2 > site/version.txt
$ python3 -m http.server 8091 --bind 127.0.0.1 --directory site

In a second terminal, request the version file. Curl's -f option reports HTTP error responses as failures, while -sS keeps normal output quiet and still shows errors.

$ curl -fsS http://127.0.0.1:8091/version.txt

The expected practice result is 2. A successful request to a version file confirms far less than a complete test of the site.

The request succeeds and prints 1. What should you investigate?

Loopback version endpoint returning version 2 from the LabEx practice server

Checking from the Client's Location

If a request on the service host works, repeat a safe check where users normally connect. A load balancer, proxy, or network rule can change the path they take. Record which address you checked and what came back. If the result does not match the release, keep the deployment under investigation.

A local request returns 2, but the public test address returns 1. Which check is most useful next?

Lesson complete

You finished Health Checks

You can now tell what each post-deployment check verified.

  • Confirm the main program is running.

  • Request an endpoint that reports the expected version.

  • Verify the user-facing path separately.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Deployment