Modern infrastructure demands observability tools that are as resilient and lightweight as the services they monitor. Uptime Medics answers this challenge with a radical architectural approach: a distributed, high-performance uptime and incident monitoring platform written entirely in Rust, delivered as a single binary operating under 30 MB of baseline RAM.
Key Takeaways
- Ultra-Lean Runtime: Single binary (Axum + Tokio + SQLite WAL) consuming < 30 MB RAM baseline.
- Zero-Signup Community Pool: Public monitoring with 10-second juggler rotation—no accounts required.
- Defense-in-Depth SSRF Protection: Filtering DNS resolver defeats rebinding; redirect hop inspection blocks metadata endpoint access.
- Smart Incident State Machine: 2-failure confirmation with flapping suppression and batched SQLite writes.
- Multi-Method Probing: HEAD, GET, POST, PATCH, PUT, DELETE, OPTIONS with custom headers/payloads up to 64 KB.

The Engineering Challenge: Why Uptime Medics Was Architected
Reliable uptime monitoring is foundational, yet existing solutions present a trilemma for developers and small teams:
- Commercial Bloat & Paywalls: Enterprise APM suites (Datadog, New Relic, Pingdom) impose strict monitor caps on free tiers and demand friction-heavy registrations for basic HTTP health checks.
- Resource-Heavy Self-Hosted Tools: Popular open-source monitors (e.g., Uptime Kuma) rely on Node.js/Electron runtimes consuming 300–800 MB RAM—inefficient for low-cost VPS deployments.
- Critical SSRF Vulnerabilities: Public monitoring forms create severe Server-Side Request Forgery vectors. Attackers probe internal networks, loopback services (
localhost), cloud metadata endpoints (169.254.169.254), or exploit DNS rebinding to pivot into cloud infrastructure. - Alert Fatigue & Flapping: Rudimentary monitors fire on single network blips or bombard engineers with repetitive cascades during rapid state oscillations.
Uptime Medics eliminates this trilemma through Rust’s zero-cost abstractions, async runtime efficiency, and a security-first network stack.
Core Architecture & Technical Stack Deep-Dive
System Topology: The Single-Binary Deployment Model
Uptime Medics is a self-contained executable integrating four critical subsystems:
┌────────────────────────────────────────┐
│ Uptime Medics Single Binary │
│ (Axum 0.8 + Tokio 1) │
│ │
│ ┌─────────────┐ ┌─────────────────┐ │
│ │ Embedded │ │ Axum HTTP API │ │
│ │ Static FE │ │ Router │ │
│ │ (rust-embed)│ └────────┬────────┘ │
│ └──────┬──────┘ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ AppState Composition Root │ │
│ │ (DB Pool, Mailer, Scheduler) │ │
│ └─────────────┬──────────────────┘ │
│ │ │
│ ┌─────────┴─────────┐ │
│ ▼ ▼ │
│ ┌──────────┐ ┌────────────┐ │
│ │ SQLite │ │ Outbound │ │
│ │ (WAL) │ │ HTTP Prober│ │
│ └──────────┘ │ (Reqwest) │ │
│ └────────────┘ │
└────────────────────────────────────────┘
Technology Stack & Version Lock
| Layer | Technology | Version | Role |
|---|---|---|---|
| Runtime | Rust | 1.82+ | Memory safety, zero-cost async |
| Web Framework | Axum | 0.8 | High-performance HTTP routing |
| Async Runtime | Tokio | 1.x | Task scheduling, I/O multiplexing |
| HTTP Client | Reqwest | 0.12 | Outbound probing with custom DNS |
| Database | SQLx + SQLite | 0.8 / WAL Mode | Embedded persistence, concurrent reads |
| Auth | Argon2id + JWT | Latest | Password hashing, stateless sessions |
| Lettre | 0.11 | SMTP notification delivery | |
| Frontend | Vanilla JS/HTML | ES Modules | Embedded via rust-embed |
SQLite WAL Mode: Concurrency Without a Server
By leveraging SQLite in Write-Ahead Logging (WAL) mode via SQLx, Uptime Medics achieves:
- Concurrent Readers: Multiple dashboard queries execute without blocking the scheduler’s write path.
- Durability: Checkpointing ensures crash consistency without a separate database process.
- Batched Write Buffering: The incident state machine aggregates state transitions, flushing to disk in optimized batches to minimize I/O overhead.
Async Scheduling Engine: The Juggler
The core scheduler (“The Juggler”) drives both private and community monitoring:
- Per-Monitor Intervals: Configurable 30 seconds to 24 hours per endpoint.
- Community Rotation: Public monitors are dynamically juggled—10 random endpoints displayed every 10 seconds on the landing page.
- Timeout Enforcement: Strict 1–60 second execution timeouts prevent hung probes from stalling the scheduler.
Key Features Breakdown & Practical Benefits
1. Zero-Signup Community Monitoring Pool
Anyone can submit a public monitor instantly via the landing page. No email, no password, no OAuth. The frontend fetches live global health telemetry (aggregate up/down ratios, response time percentiles) and rotates 10 community monitors every 10 seconds, providing a real-time “pulse” of the monitored ecosystem.
2. Multi-Layer SSRF Defense (Defense-in-Depth)
This is the architectural cornerstone for multi-tenant safety. The stack implements four independent barriers:
- Filtering DNS Resolver: Custom
reqwestDNS resolution interceptsA/AAAAresponses. It strips127.0.0.0/8,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16(cloud metadata), andfc00::/7(ULA) before the HTTP client connects. - DNS Rebinding Mitigation: The resolver enforces TTL minimums and caches resolved IPs for the probe duration, preventing malicious domains from switching from
Leave a Reply