Level 8 / Project 11 - Synthetic Monitor Runner¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | — |
Focus¶
- Callable-based check definitions with factory pattern
- Scheduled execution of health checks with configurable intervals
- Check types: HTTP status, threshold comparison, pattern matching
- History tracking with trend analysis across check runs
- Structured reporting with overall health aggregation
Why this project exists¶
Synthetic monitoring proactively detects outages by running scripted checks against your system at regular intervals — before real users hit problems. Unlike real-user monitoring that waits for complaints, synthetic checks continuously verify that login works, API responses are fast, and databases are reachable. This project builds a monitor runner that executes health checks, evaluates pass/fail criteria, tracks history for trend analysis, and generates status reports — the same pattern used by Pingdom, UptimeRobot, and custom health-check frameworks.
Run (copy/paste)¶
Expected terminal output¶
Expected artifacts¶
- Console JSON output with check results and health summary
- Passing tests
- Updated
notes.md
Alter it (required)¶
- Add a
schedule_interval_secondsfield toCheckDefinitionand implement periodic execution. - Add a
--tagsfilter flag that runs only checks matching specified tags. - Add a
historyfeature that stores the last N results per check for trend analysis.
Break it (required)¶
- Register a check with an unknown
check_type— does the factory handle it gracefully? - Set a threshold check's expected value to
None— what happens in comparison? - Mark a check as
critical=Trueand make it fail — verify the report'soverall_healthyflag.
Fix it (required)¶
- Add a default handler in the check factory for unknown check types.
- Validate that threshold values are numeric in
CheckDefinition.__post_init__. - Add a test that verifies critical check failure affects overall health status.
Explain it (teach-back)¶
- What are synthetic monitors and how do they differ from real-user monitoring?
- How does the factory pattern let you add new check types without modifying existing code?
- Why do checks have tags and how would you use them in a real monitoring system?
- What is the difference between a health check and a smoke test?
Mastery check¶
You can move on when you can: - explain synthetic monitoring vs real-user monitoring and when to use each, - add a new check type (e.g. DNS resolution) using the factory pattern, - describe how check history enables trend detection and alerting, - configure a monitoring suite for a real web service with appropriate thresholds.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|