fix: Reset lag for index builder when partitions change - #20825
Merged
Conversation
DylanGuedes
force-pushed
the
fix-index-builder-lag-report
branch
from
February 16, 2026 23:14
5444735 to
fcd2f15
Compare
joe-elliott
reviewed
Feb 17, 2026
joe-elliott
left a comment
Collaborator
There was a problem hiding this comment.
really like splitting this out by partition, but we've confirmed this won't impact any dashboards or alerts we have on this metric?
| // Convert milliseconds to seconds and calculate delay | ||
| if !recordTimestamp.IsZero() { // Only observe if timestamp is valid | ||
| p.processingDelay.Set(time.Since(recordTimestamp).Seconds()) | ||
| p.processingDelay.WithLabelValues(fmt.Sprintf("%d", partition)).Set(time.Since(recordTimestamp).Seconds()) |
Collaborator
There was a problem hiding this comment.
strconv.itoa?
seems a bit more direct than using fmt.Sprintf. same thought below.
Contributor
Author
if it does I fix it 😄 |
grobinson-grafana
approved these changes
Feb 19, 2026
This was referenced Jun 23, 2026
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.
What this PR does / why we need it:
As of now, there's some especial cases where index builders don't receive data for too long after a partition is revoked, causing excessive lag to be showing up even though it isn't really happening. I'm fixing that by resetting the lag on partitions revoking. Because I don't want to reset lags for all partitions at once, I had to add a new partition label, so that I can reset the lag only for that partition.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.mdguide (required)featPRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.mddeprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PR