-
Notifications
You must be signed in to change notification settings - Fork 39
app, helper, metrics: add milestone/vote-extension/bor-RPC observability metrics #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lucca30
wants to merge
6
commits into
develop
Choose a base branch
from
lucca/observability-metrics
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9eeb6bd
metrics: add milestone/vote-extension/bor-RPC observability
lucca30 b02a435
metrics: add milestone commit-suppression and generation-duration obs…
lucca30 4caaa69
test: cover new milestone/vote-extension/bor-RPC metric recorders
lucca30 a882088
test: kill remaining mutation-testing survivors on vote-extension/mil…
lucca30 c2f4759
fix: record ExtendVote elapsed time at every budget check, not just e…
lucca30 9ecc5c2
test: cover ExtendVoteBudgetExhaustedTotal for the restructured side-…
lucca30 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 (optional) ExtendVoteElapsedSeconds is documented as observing wall-clock elapsed "at the moment each phase's budget check ran (regardless of whether the budget was exhausted)", but RecordExtendVoteElapsed is only ever called from inside the already-exhausted branches in app/abci.go (lines 398, 469), so every sample is >= the budget deadline by construction. Operators get a histogram that cannot show "how close every turn runs to" the budget for healthy turns as the doc/PR claims -- it only restates the exhausted-counter's condition with added magnitude, losing the tail-latency-tuning signal it was built for. …
Extended reasoning...
…Fix: either record elapsed unconditionally at each checkpoint (success and exhausted paths) so the histogram covers the full distribution, or correct the doc comment to state it only measures overshoot past the deadline.
In app/abci.go,
metrics.RecordExtendVoteElapsed("side_tx_loop", startTime)andmetrics.RecordExtendVoteElapsed("pre_milestone", startTime)are each placed only inside theif budgetActive && !time.Now().Before(deadline)block, i.e. the same condition that also fires RecordExtendVoteBudgetExhausted. There is no call on the non-exhausted path through either checkpoint. As a result every observation in ExtendVoteElapsedSeconds is at or beyond extendVoteBudget, so the histogram cannot be used, as the code comment and PR description claim, to see how close normal (non-exhausted) turns run to the budget -- it silently degenerates into a duplicate/derivative of the existing counter, undermining the stated goal of tuning extendVoteBudget from tail latency.Verification: nit. The candidate accurately describes the code.
RecordExtendVoteElapsedhas exactly two non-test call sites (Grep confirms), both inside budget-exhausted branches: app/abci.go:398 sits insideif budgetActive && !time.Now().Before(deadline)(same block asRecordExtendVoteBudgetExhausted("side_tx_loop"), followed bybreak), and app/abci.go:469 sits inside the identical guard for… | nit.…There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed — both call sites sat inside the exhausted branch, so the histogram was degenerate. Fixed in c2f4759: RecordExtendVoteElapsed now fires whenever budgetActive is true, at each checkpoint, regardless of whether that particular check found the budget exhausted.