feat: long time ranges, data-aware range buttons and per-region history #62

Merged
Sebi merged 2 commits from feat/long-ranges into main 2026-11-22 09:42:44 +00:00
Owner

Stacked on #60.

  • New ranges 30d (12-hour bars), 90d (2-day), 180d (4-day) and 1y (weekly), read from the hourly and daily aggregates; SLA table gains 180d and 1y.
  • Range buttons and SLA windows are disabled until at least half of the period is covered by data. First data per monitor and region comes from the daily aggregate, and from raw results for data younger than two days.
  • Monitor pages with several regions show bars and the share of successful checks per region; regions with too little data are greyed.
  • Bars align to TimescaleDB's time_bucket origin; multi-day buckets would otherwise be shifted against Go's Truncate.

Closes #61

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

Stacked on #60. - New ranges 30d (12-hour bars), 90d (2-day), 180d (4-day) and 1y (weekly), read from the hourly and daily aggregates; SLA table gains 180d and 1y. - Range buttons and SLA windows are disabled until at least half of the period is covered by data. First data per monitor and region comes from the daily aggregate, and from raw results for data younger than two days. - Monitor pages with several regions show bars and the share of successful checks per region; regions with too little data are greyed. - Bars align to TimescaleDB's time_bucket origin; multi-day buckets would otherwise be shifted against Go's Truncate. Closes #61 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added this to the M6 Admin UI milestone 2026-11-22 08:38:45 +00:00
Sebi changed target branch from feat/time-ranges to main 2026-11-22 09:39:27 +00:00
Sebi added 19 commits 2026-11-22 09:39:27 +00:00
Closes #20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
The dashboard lists monitors with status, latency and 24-hour uptime
bars rendered as SVG on the server; monitor pages add 90-day uptime,
latency and recent checks; an editor shows the settings of the selected
check type.

Closes #17
Closes #19

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Composite foreign keys keep pages from listing monitors of other
organizations, independent of row-level security.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Pages render without JavaScript, are matched by verified custom domain
or by slug, and stay available from a stale snapshot for ten minutes if
the API is unreachable. Snapshots contain no targets or error details.

Refs #21, #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Organizations build pages from their monitors, grouped into sections
with public names, choose an accent color, logo and CSS, verify custom
domains with a TXT record and export a page as one self-contained HTML
file. Assignments scoped to a single status page are honored.

Closes #21
Closes #23
Closes #24

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Reconciliation removed every monitor missing from its database read,
including ones created in the meantime; they stayed unscheduled until
the next run a minute later. Upserts now record when they happened and
reconciliation only prunes entries older than its read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Certificates and ACME keys are stored encrypted in the database,
namespaced per owner so an organization's servers cannot read platform
or other organizations' keys. Locks live in Redis and expire.

Refs #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
With UPTIME_STATUSPAGE_TLS the server serves HTTPS with ACME
certificates for its hosts and for verified custom domains of pages it
may serve, shared by all instances through the API. Plain HTTP answers
ACME challenges and health checks and redirects everything else.

Closes #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
The previous fix read upsert times once and pruned later, so monitors
created in between were still dropped. A Lua script now checks the
upsert time and removes the entry atomically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Snapshots are persisted to UPTIME_STATUSPAGE_CACHE_DIR and loaded at
start, so pages survive restarts during an outage. Cached pages are
answered without waiting for the API, refreshed in the background and
served for as long as the API stays unreachable, with a notice once they
are older than five minutes. Only an explicit not found from the API
removes a page. Readiness no longer depends on the API when pages are
cached, the server starts without a reachable API, and certificates are
mirrored locally so HTTPS keeps working after a restart.

Closes #56

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
A trigger rejects cycles and nesting deeper than eight levels; composite
foreign keys keep groups and their monitors in one organization.

Refs #57

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Assignments scoped to a group cover all monitors and subgroups below it,
so people can be given exactly one branch of the tree. Deleting a group
moves its content one level up and drops assignments scoped to it.

Refs #57

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
The dashboard nests groups with an aggregated status, the monitor editor
offers the groups one may write to, a page manages groups, and members
can be assigned roles limited to a group or a status page. Settings move
to their own page to keep the navigation short.

Closes #57

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Refs #59

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Bars use a resolution fitting the range and the latency line is placed
by time. The SLA is the share of time a monitor was not down, counted
from incidents and only since the monitor exists. Monitor pages list the
SLA from one hour to 90 days.

Closes #59

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Refs #61

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Ranges grow to 30d, 90d, 180d and 1y, read from the aggregates, and the
SLA table to 180d and 1y. Ranges and SLA windows less than half covered
by data are shown disabled. Monitor pages chart each region separately
with its share of successful checks. Bars align to TimescaleDB's bucket
origin so multi-day buckets match.

Closes #61

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 00d3663ffe into main 2026-11-22 09:42:44 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#62