feat(monitor): save state changes for group monitors #158
Reference in New Issue
Block a user
Delete Branch "feat/group-state-history"
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?
Backlog item #12j — group state history.
Changes
checkGroup()now detects status transitions and persists state change records, matching the behavior of individual monitors. Previously, groups only updated in-memoryliveStateviaapplyState()without saving transitions — meaning History, SLA, and the detail panel's state change list were always empty for groups.Now when a group transitions (e.g. UP→DOWN because a child went down):
writeStateChangeis enqueued to persist the transitionStatusChangedAtis updated on the live stateNo change to how group status is computed — still aggregated from children using worst-status-wins logic.
Test plan
go build ./...— cleango test ./...— all passgolangci-lint run ./...— 0 issuesTestCheckGroup_SavesStateChange,TestCheckGroup_NoChangeNoWrite,TestCheckGroup_RecoveryLogTestCheckGroup_*tests still pass