Secrets & observability
Build-along · ~12 min at your own keyboard
Two disciplines separate deployed from durable: secrets live in the platform's encrypted config (never in the deployed code), and every run logs somewhere you actually look — a Slack channel, a log sheet. A cloud job that fails silently at 3am fails for weeks.
The long version: Secrets and run logs ↗
Mac: Mac: set a local variable with export NAME=value in Terminal, and add it to ~/.zshrc to keep it.
Windows: Windows: set a local variable with $env:NAME='value' in PowerShell. Use setx NAME value to keep it for new windows.
Do this
0/4Checkpoints
- ▸You should now see your keys listed in the platform's secrets, not in the code.
- ▸You should now see one log line per run with time, counts and OK or FAIL.
- ▸You should now see a FAIL line after you forced a failure.
- ▸You should now see an alarm when the expected line is missing.
The three ways this goes wrong
- The key still sits in a file in your project. — Delete it from the file and rotate the key, then add the new one to secrets.
- The forced failure shows no log line. — Make the script catch errors and write FAIL with the reason before it exits.
- Nobody notices when the job stops altogether. — Add a heartbeat check: no line by the expected time sends you an alert.
Share what happened
Paste a real OK log line, the forced FAIL line, and where they land.
Strip API keys, passwords, and tokens before you paste. Swap them for [KEY].
🔒 Don't paste confidential, personal-health, or payment info.