Every console page that shows monitor status (monitors, incidents,
monitor details, evidence) went through one loader that read, for all of
the organization's monitors:
- the newest result per monitor and region, by scanning a day of raw
results;
- the bars of the selected range, from raw results for ranges up to 24h,
though only one page of monitors is shown;
- when each monitor first reported, scanning two days of results.
With 3000 monitors that took about a second, growing with the number of
results. Now:
- latest_results keeps the newest result per monitor and region,
updated as results are stored (migration 00055 fills it from the last
day);
- bars are loaded only for the monitors a page shows;
- first data is loaded per monitor on its page, and the monitor list asks
only for the organization's earliest data, by index;
- monitor, region and incident queries name the organization, so their
indexes are used instead of row security filtering whole tables.
Public status pages also read only their own monitors' latest results
and hourly buckets instead of the whole organization's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
A region whose checkers had all gone left its monitors looking up: the
console and status pages took the last result, however old, and nobody
was told.
- A region's last result counts only while it is younger than the
evaluator's staleness (3 intervals, at least 2 minutes); older ones
show as "no data since …" in the console and leave status page
components unknown instead of operational.
- A monitor no region has reported for recently is marked "not being
checked", counted on the dashboard with an explanation, and noted on
its page.
- A region watch on every API replica emails the platform's admins
(platform regions) or the organization's owners (own regions) once a
region with checkers and enabled monitors has had no live checker for
UPTIME_REGION_ALERT_AFTER (default 5m), and again when one is back.
The dashboard names such regions at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3