feat(observability): make the stranded-operation reaper visible while idle - #973
Draft
aparajon wants to merge 2 commits into
Draft
feat(observability): make the stranded-operation reaper visible while idle#973aparajon wants to merge 2 commits into
aparajon wants to merge 2 commits into
Conversation
… idle An idle reaper pass is silent by design: it settles nothing, and an instance that loses the election has nothing to report. That leaves a healthy steady state indistinguishable from a reaper that stopped ticking, and hours of INFO logs answer neither question. The loop now states its cadence and batch size once at startup, and closes every window of passes with one heartbeat line tallying passes run, operations settled, passes that stood down for another instance, and passes that failed. An operator reading INFO logs can tell a reaper with nothing to do from one that is not running. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds periodic “heartbeat” observability to the stranded-operation reaper so operators can distinguish a healthy idle reaper from a stalled or unelected one, without logging every pass.
Changes:
- Introduces a heartbeat window that summarizes pass outcomes (ran / not elected / failed) and total operations settled.
- Emits a one-time startup INFO log stating cadence, batch size, and heartbeat window size; upgrades stop logs to INFO.
- Adds unit tests covering heartbeat window behavior and outcome tallies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/api/reaper.go | Adds heartbeat aggregation + startup/heartbeat logs; refactors reaper pass to return an outcome and settled count. |
| pkg/api/reaper_test.go | Adds tests validating heartbeat summary emission, outcome tallies, and window reset behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…pped A pass that finished cleanly just as the context ended logged "error": null, which reads as a fault with no cause. The shutdown branch now reports ctx.Err() as the reason and carries the pass's own error, when it has one, under its own key so the two causes stay distinguishable. Co-Authored-By: Claude Fable 5 <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.
Why this matters
An idle reaper pass is silent by design: it settles nothing, and an instance that loses the election has nothing to report at all. That leaves a healthy steady state indistinguishable from a reaper that stopped ticking — hours of INFO logs answer neither question, and telling the two apart is the first thing an operator needs during an incident.
What it does
Summarizing a window rather than narrating every pass keeps a healthy reaper to a few lines an hour — quiet enough to leave on, frequent enough that its absence is noticeable.
🤖 Generated with Claude Code