Portfolio

Status Rectory: a status page and verifiable uptime for the Rectory ecosystem

A status page and uptime monitor for Rectory's services, live at status.rectory.cl. Automated checks, a 12-section admin panel, maintenance that only gets excluded when announced 48 h ahead, a monthly report sealed with SHA-256 and a daily bulletin written with Gemini. Sole developer. Flask, Celery, Redis and MySQL.

In production Tech lead

Leer en español

Status Rectory: a status page and verifiable uptime for the Rectory ecosystem

Status Rectory: a status page and verifiable uptime for the Rectory ecosystem

Rectory had to prove an institutional requirement marked as critical: monthly uptime ≥ 99.5%, excluding notified maintenance, with a verifiable calculation or the gap reported. Saying "we're up" wasn't enough. It needed measurements, a written methodology and a report someone else could audit. So I built Status Rectory: it watches the services from the outside, publishes their status at status.rectory.cl and closes every month with a sealed report.

In 30 seconds

  • What I built: a status page with an uptime monitor, an admin panel and a monthly SLA report, live at status.rectory.cl since October 9, 2026.
  • My role: sole developer (10 of 10 commits). Backend, frontend, SLA calculation, deployment and documentation.
  • Result: it checks Rectory App, Libro Digital and IA Rectory every minute. In October both critical services met the target: 99.731% and 99.955%.
  • The surprise: a month doesn't always last the same. September 2026 in Santiago has 719 hours because of the daylight saving change, and the calculation had to know that.
  • Stack: Flask, Celery, Redis, MySQL, WeasyPrint, Bootstrap 5, Chart.js and Google Gemini for the daily bulletin.

The public page in production: current status, an announced maintenance window and 90-day bars per service

Overview
RoleFull-stack developer, sole author
PeriodOctober 9 to November 30, 2026
TypeStatus page, uptime monitoring and SLA reporting
StatusIn production
CodePrivate; this case study uses screenshots and selected snippets

What I built

PieceWhat I didWhy
MonitoringHTTP, keyword, TCP, ping, DNS and TLS certificate checks, each service on its own intervalSee the services the way a user does, from outside their network
DetectionAn outage opens after N failures in a row and is dated from the first oneA single failed check doesn't count as an outage, and confirming one doesn't steal minutes from the math
Criticality policiesFour levels (Critical, High, Medium, Low) with editable targets, thresholds and confirmation rulesPut in writing what "critical uptime" means
MaintenanceOne-off windows and weekly rules; only windows announced 48 h ahead get excludedMeet the "notified maintenance" clause in a way nobody can game
Monthly reportAutomatic draft on the 1st, mandatory gap notes, SHA-256 seal, PDF and interval CSVAnyone can recompute the percentage
Public pageStatus, incidents, maintenance, monthly uptime, RSS, JSON API, SVG badges and email subscriptionsSchools find out without having to ask
AlertsEmail, HMAC-signed webhook, Slack, Discord, Teams and Telegram, with retriesWarn the team before a school calls
Daily bulletinA plain-language status summary written with Gemini and published to the RSS feedTell the day's story in simple words

Two faces: the public page and the admin panel

The public page answers one question: is Rectory working right now? It shows each service's status, 90 days of history, incidents with their updates and scheduled maintenance. It works on phones, has a dark mode and comes in Spanish and English.

The public page on a phone: status, monthly report and daily bulletin

The admin panel is where the team works. I built it with 12 sections: dashboard, monitors, outages, incidents, maintenance, criticality policies, monthly reports, service groups, alert channels, alert log, users and audit log. Every change lands in the audit log with who made it.

The admin screenshots come from a local instance loaded with the repository's demo data (89 days of synthetic history), so no internal addresses or hosts get published. The public page and its numbers come from production.

The dashboard gathers what matters when you log in: how many services are up, daily uptime against the target, the health of the monitoring system itself and how much error budget each critical service has left this month.

Admin dashboard: counters, 30-day uptime against the target, monitoring health and error budget

The monitors list filters by status, group and criticality, and each row lets you check now, edit or pause.

Monitor list with check type, criticality, status and response time

Each monitor's detail page shows its uptime over 24 hours, 7, 30 and 90 days, the month's SLA with its error budget, check coverage and response time.

Monitor detail: monthly SLA, configuration and response time over the last 24 hours

Criticality policies set the target for each level. The form turns the percentage into time: 99.5% over a 30-day month allows 3 h 36 min of downtime.

Criticality policies with target, allowed downtime and detection rules

The interesting part: a 99.5% someone else can recompute

Any system can show a percentage. The requirement asked for a verifiable one, and that shaped the whole design.

I wrote the methodology before the code and versioned it (v1.0):

period       = [start of month, min(end of month, now)] ∩ [monitor created, ∞)
maintenance  = ∪ the monitor's windows announced ≥ 48 h ahead
eligible     = |period| − |maintenance|
downtime     = |(∪ non-excluded outages ∩ period) − maintenance|
uptime %     = 100 × (eligible − downtime) / eligible

Three decisions follow from it:

  • Measure time, starting from confirmed outages. Counting good and bad checks depends on the interval and drifts when a worker falls behind. An outage with a start and an end can be checked by hand.
  • Store the inputs behind every number. Each report row keeps the intervals it used. The interval CSV lets you redo the math in a spreadsheet.
  • Seal the report. When the month is finalized, the system computes a SHA-256 over the report data and verifies it again on every view. If someone edits a row in the database, the page flags it.

The report also refuses to close with uncomfortable data hidden. If a critical service misses the target or lacks coverage, nobody can finalize the month without writing down the cause and an action plan. That covers the second half of the requirement: "or the gap reported".

October report in the admin panel: final sealed status, verified checksum and per-service result

In production, October ended like this:

ServicePolicyUptimeDowntimeExcluded maintenance
Libro Digital RectoryCritical (99.5%)99.731%1 h 27 min3 h
Rectory AppCritical (99.5%)99.955%14 min 41 s3 h
IA RectoryHigh (99.0%)100.000%0 s3 h

Libro Digital met the target, but it used 54% of its error budget for the month. The dashboard surfaces that kind of number before it's too late: an "SLA at risk" alert fires when a service burns through 75%.

October uptime report on the production public page, with the methodology in plain view

Deep dive: the technical decisions

1. Three processes and a schedule that lives in the database

Status Rectory runs as three processes: the web app (Flask on gunicorn), the Celery workers and a beat process that fires periodic tasks. Redis acts as the broker, holds the locks and caches the public page.

Each check's schedule doesn't live in Celery beat: every monitor stores its own next_check_at in the database. Every 10 seconds, beat takes a lock in Redis, finds the monitors that are due and queues them. That gives me:

  • a separate interval for each service,
  • a schedule that survives restarts,
  • a quick re-check 20 seconds after a failure instead of waiting a full interval,
  • no duplicate checks if someone starts two beats by mistake.

The monitor also watches itself. /healthz returns 503 if the database or Redis stops responding or if beat stops dispatching, so an external service can point at it.

2. An outage gets confirmed, then dated from the first failure

Under the Critical policy, an outage needs two failures in a row:

10:00:00  ok
10:01:00  FAIL    ← first failure; re-check at 10:01:20
10:01:20  FAIL    ← outage confirmed, dated from 10:01:00
   …
10:15:20  ok      ← first success
10:16:20  ok      ← recovery confirmed; the outage ends at 10:15:20
                  → 14 min 20 s outage

Waiting for confirmation keeps a single timeout from counting as an outage. Dating it from the first failure keeps that wait from shaving minutes off the math. A slow service or one with an expiring certificate is degraded: it raises a warning but doesn't cost uptime.

3. Interval arithmetic so nothing counts twice

Two overlapping outages, or an outage inside a maintenance window, break a naive calculation. I solved uptime with three interval operations: merge, clip and subtract.

def merge(intervals) -> list[Interval]:
    """Sort and coalesce overlapping/adjacent intervals; drops empty ones."""
    cleaned = sorted((s, e) for s, e in intervals if e > s)
    merged: list[list[datetime]] = []
    for start, end in cleaned:
        if merged and start <= merged[-1][1]:
            merged[-1][1] = max(merged[-1][1], end)
        else:
            merged.append([start, end])
    return [(s, e) for s, e in merged]
down = merge(clip([(o.started_at, o.ended_at or now) for o in counted], period_start, period_end))
downtime = subtract(down, maintenance)

Months are cut in Santiago time, not UTC. September 2026 lasts 719 hours because clocks spring forward on September 6, and with 4 hours of downtime the result is 99.444%: not met. That case is a test.

4. "Notified" means announced 48 hours ahead

If every maintenance window got excluded, you could create one after an outage and erase it. So a window only counts as excluded when it was announced in time:

def is_properly_notified(self, min_notice_hours: float) -> bool:
    if self.is_cancelled or self.notified_at is None:
        return False
    return self.notified_at <= self.starts_at - timedelta(hours=min_notice_hours)

A window announced three hours ahead shows up in the panel as "Counts as downtime". For routine work I added weekly rules, such as "Sundays at 03:00, 45 minutes". An hourly task creates the windows for the next 9 days (48 hours plus a week), already announced, and notifies the alert channels and subscribers.

Maintenance: a weekly rule, excluded windows and an urgent window that counts as downtime

5. A daily bulletin written by AI, using public data only

Every morning a cron job asks ai-service, Rectory's AI service, for a bulletin about the previous day. The bulletin goes out on the RSS feed and on its own page.

  • Public data only. The snapshot sent to Gemini holds what the page already shows: statuses, uptime, public incidents and maintenance. No IP or internal host leaves the system.
  • Signed request. Status Rectory signs the call with HMAC-SHA256, and ai-service rejects any request without that signature.
  • Structured output. Gemini returns JSON with a title and body, validated with Pydantic. If the answer comes back truncated or empty, nothing gets published.
  • An Easter egg. One day in ten, a Night City reporter writes the bulletin, with a higher temperature to improvise and the facts pinned by the prompt.

Daily bulletin written with Gemini, published in production on November 30

6. Documented for the next developer

I left four documents in docs/: architecture, SLA methodology, development setup and deployment. The SLA one also speaks to whoever answers for compliance, with the month-close procedure. The tests cover the methodology: interval arithmetic, on-time and late maintenance, overlaps, daylight saving changes, the state machine and detection of a tampered report.

By the numbers

MetricValue
In productionsince October 9, 2026
Commits10, all mine
Code7,541 lines of Python in the app and 42 templates
Tests45 (44 pass; the PDF one is skipped when Pango is missing)
Documentation2,426 lines across the README and docs/
Check types6
Alert channels6
Admin sections12
October uptime (critical services)99.731% and 99.955%, target 99.5%

What I take away

On the technical side, I learned that "verifiable" is a design decision from day one. It pushed me to write the methodology before the code, to store the inputs behind every number and to handle time with care: time zones, daylight saving and overlapping outages.

On the professional side, I take away the value of reading a requirement word by word. "Notified" turned into a 48-hour rule, and "or the gap reported" turned into a report that won't close until someone explains what failed.

The public page and the October numbers come from production (November 2026). The admin views come from a local instance with demo data.

Project screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7 Screenshot 8 Screenshot 9 Screenshot 10
← All projects