You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: drop stale schedule metrics after rename - #212
Renaming a backup schedule leaves metric series with the old schedule_name, which can trigger a false stale-backup alert. Detect renames in the schedule watcher and remove the old gauge series after reporting current metrics in each replica.
Adds a regression test for renaming and preserving backup metrics without a schedule_name label.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The metrics mock omits cleanup of schedules_failed_count and schedules_succeeded_count, causing tests to retain stale counters after deletions and accumulate them across renames, unlike production.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Mock cleanup leaves schedule counters behind
internal/metrics/metrics_mock.go:190
The mock does not delete schedules_failed_count or schedules_succeeded_count, although the production implementation now deletes both during name cleanup. Consequently, tests using InitializeMockMetricsRegistry retain run counters after deletion and accumulate them across renames, unlike production. Delete both counter entries here as well so the mock reflects the new cleanup behavior.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Rename cleanup in the label-less mock deletes newly written schedule gauges, leaving timestamp and RPO values absent until the next cycle and diverging from the real registry’s behavior.
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
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.
Renaming a backup schedule leaves metric series with the old
schedule_name, which can trigger a false stale-backup alert. Detect renames in the schedule watcher and remove the old gauge series after reporting current metrics in each replica.Adds a regression test for renaming and preserving backup metrics without a
schedule_namelabel.