Find a failure and prove recovery
Use application state, logs, sensor freshness, and a repeatable check to debug a deployment.
Requirements and learning goals
Before you start
- The hello-wendy Node project from the first three lessons
- A known successful request or sensor observation
You will be able to
- Distinguish build, startup, connectivity, and functional failures
- Write a recovery check for a demo runbook
The project brief below assumes the listed prerequisites and gives you a task and checks to perform. Need a guided first project?
Observability means making an application explain what it is doing through logs, state, and measurements. It helps you tell whether a frozen dashboard comes from a dead sensor, a crashed app, or a network problem. Recovery means restoring the actual behavior, not merely restarting a process.
Debug the last boundary that worked. A build error, crashing process, unreachable endpoint, and stale camera feed require different checks.
For intermittent failures, pair logs with sensor recordings so you can inspect the input that caused the failure.
Return to hello-wendy if you tried the separate multi-service exercise. Deploy it using its existing build format and use its printed HTTP URL as the functional check.
Establish a baseline
Save one successful request or sensor observation. Then inspect the selected target:
wendy device info
wendy device apps list
wendy device logs --app YOUR_APPUse the exact app name from the list. A stopped one-shot program may have completed successfully; a long-running server that repeatedly exits needs investigation.
Inject and repair one fault
In src/index.ts, temporarily change the counter path from /data/starts.txt to /missing-directory/starts.txt. Deploy and expect an ENOENT startup error. Save that error, restore /data/starts.txt, and redeploy. Check the HTTP response again and confirm the startup count increases.
Then rehearse stopping and restarting:
wendy device apps stop YOUR_APP
wendy device apps start YOUR_APPInspect state and application output after each operation. An acknowledgement establishes that a request was accepted, not that the full application recovered.
Make stale data visible
Track receipt age with a monotonic clock:
import time
last_received = time.monotonic()
def sample_is_fresh():
return time.monotonic() - last_received < 1.0Update the timestamp for each valid sample. Choose the timeout for your sensor rate. Receipt age detects silence; checking capture age also requires understanding the source clock.
Finish with a runbook containing target, app name, startup command, expected output, stop command, and recovery check. Optional extension: trigger a Wendy Data episode when a fault occurs.
Source: Application states and lifecycle.
Before you move on
Can you do each of these?
- Distinguish build, startup, connectivity, and functional failures
- Write a recovery check for a demo runbook
0 of 2 checkpoints solved. Try checkpoint 1