Skip to content

feat(status): real uptime + incidents from UptimeRobot#29

Merged
WayforthOfficial merged 1 commit into
mainfrom
feat/uptime-from-uptimerobot
Jun 20, 2026
Merged

feat(status): real uptime + incidents from UptimeRobot#29
WayforthOfficial merged 1 commit into
mainfrom
feat/uptime-from-uptimerobot

Conversation

@WayforthOfficial

Copy link
Copy Markdown
Owner

Follow-up to #28 (honesty fix). Wires /system/status to the decided source — UptimeRobot — instead of leaving uptime_30d/incidents null.

  • uptime_30d = the Wayforth Gateway monitor's 30-day custom_uptime_ratio (real).
  • incidents = real down-events from the monitor's logs — an actual outage (e.g. the rank-service one) shows up, not a fabricated "none in 90 days".
  • Cached ~5 min in-process; never hammers UptimeRobot.
  • uptime_source: "uptimerobot" when real, "unmeasured" when not.

Fail-safe by construction: no key / API error / network failure → uptime_30d:null, uptime_source:"unmeasured", incidents:null. Never a fabricated number. Safe to deploy before the key is set — stays unmeasured until UPTIMEROBOT_API_KEY is present, then lights up automatically (≤5 min cache).

Config (backend env — you set these)

  • UPTIMEROBOT_API_KEY — read-only key (also accepts UPTIMEROBOT_READ_ONLY_KEY)
  • UPTIMEROBOT_MONITOR_ID (optional) — pin the exact monitor; else matched by name (gateway/wayforth), else first.

Tests

6 offline: fail-safe (no key), monitor pick, pinned id, down-events-only, live-payload parse, api-error fallback.

🤖 Generated with Claude Code

Follow-up to the honesty fix (#28). /system/status now sources uptime_30d and
incidents from UptimeRobot's getMonitors API (read-only key) instead of leaving
them null:
 - uptime_30d = the Wayforth Gateway monitor's 30-day custom_uptime_ratio.
 - incidents  = real down-events from the monitor's logs (so an actual outage,
   e.g. the rank-service one, shows up — not a fabricated "none in 90 days").
 - cached ~5 min in-process; never hammers UptimeRobot.

Fail-safe by construction: no key configured, API error, or network failure →
uptime_30d=None / uptime_source="unmeasured" / incidents=None. NEVER a
fabricated number. Safe to deploy before the key is set — stays unmeasured until
UPTIMEROBOT_API_KEY is present, then lights up automatically.

Config: UPTIMEROBOT_API_KEY (read-only; also accepts UPTIMEROBOT_READ_ONLY_KEY),
optional UPTIMEROBOT_MONITOR_ID to pin the monitor (else matched by name).

Tests: 6 offline (fail-safe, monitor pick, pinned id, down-events-only, live
payload parse, api-error fallback).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@WayforthOfficial WayforthOfficial merged commit 6d55d9e into main Jun 20, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants