feat(sources): log poll failures and recoveries with source context #38
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!38
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/16-poll-logging"
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 #16.
The Poller logged
[id] poll failed: msgon every interval, with no source type, name, HTTP status or duration. Now it logs state changes:Source 3 (Proxmox VE "pve") poll failed after 412ms (HTTP 401): pve rejected the credentials (HTTP 401). Check the API token.Metadata: source_id, source_type, http_status, duration_ms.Source 3 (Proxmox VE "pve") recovered after 5 failed polls (300s); polled in 120ms.The HTTP status is read from the
HTTP NNNthe shared Sources.HTTP helpers put in every error message, so it's set for all HTTP sources without changing the SourceType contract.poll_once/2(Test connection, tests) still warns on every failure since it has no history. Processing errors also carry source_id/source_type metadata now.Tests: new sync PollerLoggingTest drives a real Poller through scripted results (start failing, same error again, a different error, recovery, healthy).
mix precommit: 806 passed.