feat(sources): add Uptime Robot source #7
No reviewers
Labels
No labels
bug
docs
duplicate
enhancement
help wanted
invalid
nice-to-have
pre-1.0
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/lamplighter!7
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/4-uptime-robot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #4
Adds an Uptime Robot source (
uptime_robot), a:problemssource modeled on the Uptime Kuma one, reading Uptime Robot's v3 API (GET https://api.uptimerobot.com/v3/monitors, bearer read-only API key). v2 is legacy (keys in POST bodies); v3 is the documented REST API with cursor pagination and a published OpenAPI spec, which the fixture is shaped after.What it reports
monitor:<id>(:incident), from the monitor's status:DOWN→ failing, with Uptime Robot's incident reason as why (e.g. "Connection Timeout") and the incident'sstartedAtas the report startLOOKS_DOWN(Uptime Robot confirming from other regions) andSTARTED(not checked yet) → pendingPAUSED→ suppressed, or a warning when Report paused monitors is onUP→ okmonitor:<id>:certificate(:security), fromsslExpiryDateTime: warning/critical within the configured days, critical once expired (skipped for paused monitors)Settings
API key (secret, required), Only monitors tagged (passed to the API's
tagsfilter), Report paused monitors, and certificate warning/critical days (validated so critical ≤ warning). Monitors taggedlamplighter:ignoreare skipped;lamplighter:warning|serious|critical(orlamplighter-…) set severity when down.Errors and logging
Retry-After) and explains the free plan's 10 req/minHTTP.describe_transport_error) are explainedLogger.warningon failed polls with the URL and duration,Logger.debugwith monitor/page counts and duration, and a warning whenX-RateLimit-Remainingdrops to ≤ 1nextLinkcursors (200 per page, capped at 50 pages)README gets an Uptime Robot section.
Screenshots
Settings form with example values, desktop and 390px:
Source type picker:
Testing
test/lamplighter/sources/uptime_robot_test.exs: 18 tests withReq.Teststubs (auth header, tags filter, cursor pagination, 401/429/bad body/transport errors, rate-limit log) and a fixture covering every status, tags, and certificatesmix precommit: 624 tests pass, no warnings, formattedNot tried against a live Uptime Robot account (no key here); status strings follow the API's documented filter values (
PAUSED, STARTED, UP, LOOKS_DOWN, DOWN).