Description
Screenshots are stored as PNG files on the server filesystem (lib/session.rb:57). The ScreenshotFile class manages retention via retain/release reference counting, but there is no:
- Disk usage cap per account
- Maximum number of screenshots per health check
- Age-based cleanup policy
- Compression beyond
pngcrush
Full-page screenshots at high resolution can be 500KB–2MB each. With 1-minute checks and multiple TakeScreenshotStep steps, a single health check can generate gigabytes per day.
Impact
- Disk exhaustion on the host server causes all checks to fail.
- No multi-tenant fairness: one account can consume all disk space.
- No cost visibility for screenshot storage.
Suggested approach
- Add a
max_screenshots setting per health check or account.
- Implement a background job that prunes screenshots older than N days.
- Consider storing screenshots in object storage (S3, GCS) instead of local filesystem.
- Add disk usage monitoring/alerting.
Effort: medium
Description
Screenshots are stored as PNG files on the server filesystem (
lib/session.rb:57). TheScreenshotFileclass manages retention viaretain/releasereference counting, but there is no:pngcrushFull-page screenshots at high resolution can be 500KB–2MB each. With 1-minute checks and multiple
TakeScreenshotStepsteps, a single health check can generate gigabytes per day.Impact
Suggested approach
max_screenshotssetting per health check or account.Effort: medium