Screenshots & Visual Regression
Auto-capture failure screenshots and detect visual regressions against a baseline using perceptual hashing.
Screenshots & Visual Regression
Two related but distinct features: failure screenshots capture what your site looked like when it went down. Visual regression compares each check against a baseline and flags pixel-level changes.
Failure screenshots
When a monitor flips to down or degraded, Happy Uptime triggers a Cloudflare Browser Rendering session against the monitor's URL, captures a PNG at three viewports (desktop / tablet / mobile), and stores it in R2 keyed by screenshots/{monitorId}/{checkResultId}.png.
You see the screenshot:
- In the alert payload (Slack message includes a thumbnail link)
- On the monitor detail page in the dashboard
- Via
GET /screenshots?monitor_id=…
Storage retention: 30 days for failure screenshots. Baselines are kept indefinitely.
Visual regression
Enable screenshot_compare: true on the monitor, capture a baseline (one click in the dashboard), and every successful check thereafter:
- Captures a fresh screenshot.
- Computes a perceptual hash (pHash).
- Compares against the baseline's hash.
- If the diff exceeds
screenshot_threshold(default0.05, range 0–1), fires avisual_regressionalert.
Use cases:
- Marketing site got hijacked? Visual regression catches it before keyword monitoring.
- A deploy accidentally pushed staging banners to prod? Regression catches it.
- A vendor (e.g. payment provider iframe) breaks visually but still returns 200? Regression catches it.
Per-viewport baselines
Capture separate baselines for desktop/tablet/mobile. Useful when responsive breakpoints render differently and you want to detect changes only at one breakpoint.