Back to lessons

Web Server Rescue

Smoke Check an HTTP Status

You need a quick status-code check after a deployment.

Command

curl -fsS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.com/health

What changed

Nothing changes locally. The command sends one HTTP GET request.

Danger

safe

When to use it

Use after deployments, restarts, or DNS changes.

When not to use it

Do not use it for endpoints where a GET request has side effects.

Undo or recovery

No undo needed because this command is read-only locally.

Expected output

A status code and total request time, such as 200 0.183s.

demo script

Disposable terminal steps

  1. printf 'Checking endpoint status\n'
  2. curl -fsS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.com/health

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ printf 'Checking endpoint status\n'
Checking endpoint status
::exit-code::0
$ curl -fsS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.com/health
200 0.042000s
::exit-code::0

YouTube Short

Deploy smoke check.

Use curl to print just the HTTP status and timing. It is the fastest post-deploy heartbeat.

LinkedIn hook

A deploy is not done until the endpoint answers.

Question: What is your minimum smoke check after deployment?

experiments

A/B tests to run

Metric: completion_rate

A: Deploy smoke check.

B: Is the site alive?