feat(status): real uptime + incidents from UptimeRobot#29
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #28 (honesty fix). Wires
/system/statusto the decided source — UptimeRobot — instead of leavinguptime_30d/incidentsnull.uptime_30d= the Wayforth Gateway monitor's 30-daycustom_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".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 untilUPTIMEROBOT_API_KEYis present, then lights up automatically (≤5 min cache).Config (backend env — you set these)
UPTIMEROBOT_API_KEY— read-only key (also acceptsUPTIMEROBOT_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