PythonFlaskMonitoringDevOps

Uptime Monitor

Background thread pings the portfolio API and site every 60 seconds, recording response times. Graphs the last 24 hours of data pulled live from the server using Canvas charts.

Ping interval

60 seconds

History

24 hours

Backend

Flask + threading

Chart

Canvas (zero deps)

How it works

1Daemon Thread
260s Ping
3HTTP GET
4Record Status
5JSON Write
6API Endpoint
7Canvas Chart

How It Works

Daemon thread launches with Flask app via gunicorn. Every 60 seconds: HTTP GET to each target, record status + response time in ms. Append to JSON file, keep last 1,440 entries (24h). API endpoint returns history, frontend draws Canvas chart.

Decisions

Daemon thread over cron — simpler, dies with the app. JSON file storage because 24h of 1-minute checks is only 1,440 entries (trivially small). Canvas charts over a chart library to keep dependencies at zero. Atomic file writes prevent corruption.

Security

  • Atomic file writes prevent data corruption
  • Read-only monitoring — no write access to monitored targets

Want something like this built for your business?

I'll look at your problem, figure out the right approach, and ship working software. No slideshows.

Book a free consultation