Level 7 / Project 08 - Ingestion Observability Kit¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | — |
Focus¶
- metrics and event visibility pipeline
Why this project exists¶
This project gives you level-appropriate practice in a realistic operations context. Goal: run the baseline, alter behavior, break one assumption, recover safely, and explain the fix.
Run (copy/paste)¶
Use <repo-root> as the folder containing this repository's README.md.
cd <repo-root>/projects/level-7/08-ingestion-observability-kit
python project.py --input data/sample_input.txt --output data/output_summary.json
pytest -q
Expected terminal output¶
Expected artifacts¶
data/output_summary.json- Passing tests
- Updated
notes.md
Alter it (required)¶
- Add a
filter_logs(stage, level)method to the ObservabilityKit that returns matching log entries. - Add a third pipeline stage (e.g.
"load") that writes records to a dict-based store. - Re-run script and tests — verify the new stage metrics appear in the summary.
Break it (required)¶
- Call
end_stage()for a stage name that was never started withstart_stage(). - Pass an empty records list and check if error_rate causes a division-by-zero.
- Observe the KeyError or ZeroDivisionError in the output.
Fix it (required)¶
- Check if the stage exists in
self.metricsbefore accessing it inend_stage(). - Guard the
error_rateproperty against zerorows_in(already done — verify it). - Add a test that calls
end_stageon an unknown stage and expects a clear error.
Explain it (teach-back)¶
- Why are correlation IDs essential for debugging pipeline failures?
- What happened when end_stage was called for an unregistered stage?
- How did the KeyError check prevent the crash?
- How does structured logging differ from print-statement debugging?
Mastery check¶
You can move on when you can: - run baseline without docs, - explain one core function line-by-line, - break and recover in one session, - keep tests passing after your change.
Related Concepts¶
- Errors and Debugging
- Files and Paths
- How Imports Work
- Virtual Environments
- Quiz: Errors and Debugging
| ← Prev | Home | Next → |
|---|---|---|