Design a Website Monitoring Service
CoreweaveSoftware Engineer · OnsiteLast updated
Design a globally distributed synthetic website monitoring service that executes periodic health probes, mitigates false-positive alerts, and ingests high-volume time-series metrics.
Scenario
Design a multi-region synthetic monitoring platform (similar to Pingdom or Datadog Synthetics) that allows users to monitor the availability, response time, and correctness of their public websites and APIs.
Requirements
Functional Requirements
- Check Configuration: Users can register endpoints with custom HTTP methods, headers, payload validation rules (e.g., status code
200, response body regex), check intervals (10s to 10m), and selected geographic probe regions. - Distributed Probing: Lightweight probe workers in multiple global regions execute checks against configured endpoints according to their schedule.
- Alerting: Alert users via webhooks/email/SMS when an endpoint fails. Alerts must avoid triggering on localized, transient network blips.
- Dashboard & Reporting: Provide real-time and historical uptime percentages, latency percentiles (p50, p95, p99), and failure logs.
Non-Functional Requirements
- Low False-Positive Rate: Transits, BGP flaps, or single-probe issues must not generate false alarms.
- High Availability & Scalability: The scheduler and ingestion pipeline must handle checks continuously without missing probe windows.
- Alert Latency: Notifications must be dispatched within 30 seconds of a confirmed failure condition.
Scale & Estimations
- Monitored Endpoints: 5,000,000 targets.
- Average Check Interval: 60 seconds, resulting in ~83,000 executions per second globally.
- Regions: 8 distinct cloud/edge regions running active probes.
- Data Retention: Raw check logs retained for 14 days; downsampled hourly/daily metrics retained for 1 year.
Key Areas to Address
- Scheduler & Execution Architecture: How checks are assigned, scheduled, and dispatched to probe nodes across multiple regions without thundering herd problems.
- False-Positive Mitigation: How the system confirms a failure (e.g., cross-region quorum, local retries) before firing an alert.
- Data Ingestion & Storage: Schema and storage strategy for high-throughput time-series results and raw execution logs.
- Alerting Pipeline: Stateful alert rule evaluation, deduplication, and suppression logic.
Hints
Hint 1
Decouple check definition management from execution by using consistent hashing or partitioned message queues to distribute probe targets to regional worker pools.
Hint 2
Prevent transient alerts by requiring secondary regional confirmations or consecutive failed runs before transitioning an endpoint's state from Healthy to Degraded/Down.
Hint 3
Separate the hot-path metrics pipeline (time-series counters and histograms) from the diagnostic storage path (full HTTP headers, error bodies, and trace timings).
Follow-up questions
- How would you prevent Server-Side Request Forgery (SSRF) and abuse if a user configures checks pointing to internal cloud metadata endpoints or private IPs?
- How does your scheduling system adapt if an endpoint's response takes 25 seconds to time out on a 30-second check interval?
- How would you support multi-step transaction checks (e.g., log in -> add item to cart -> checkout) within this architecture?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.