Fix mimir.rules.kubernetes panic on non-leader debug info retrieval#3451
Merged
dehaansa merged 2 commits intografana:mainfrom Apr 25, 2025
Merged
Fix mimir.rules.kubernetes panic on non-leader debug info retrieval#3451dehaansa merged 2 commits intografana:mainfrom
dehaansa merged 2 commits intografana:mainfrom
Conversation
dehaansa
requested changes
Apr 25, 2025
Contributor
dehaansa
left a comment
There was a problem hiding this comment.
This doesn't work as written, as the iteration over rulesByNamespace would need to be inside the if block as well.
However, the go-idiomatic way to write this would be using a guard statement, and returning early at the top of the function.
You'll also need to make a bugfix changelog entry.
Thanks for looking to improve Alloy!
if c.eventProcessor == nil {
return output
}
dehaansa
approved these changes
Apr 25, 2025
Contributor
dehaansa
left a comment
There was a problem hiding this comment.
Looks to be a flaky test in CI. Once I can get it to pass, I'll merge. Thanks for the fix!
kalleep
pushed a commit
that referenced
this pull request
May 5, 2025
…3451) * Fix mimir.rules.kubernetes to only return eventProcessor state if it exists
kalleep
added a commit
that referenced
this pull request
May 5, 2025
* fix: panic that happens when a target gets deleted when using decompression (#3475) * Fix panic caused that can happen when when file is removed for decompressor * Change to start readLine start and stops updatePositions * Add changelog * Fix mimir.rules.kubernetes panic on non-leader debug info retrieval (#3451) * Fix mimir.rules.kubernetes to only return eventProcessor state if it exists * fix: deadlock in loki.source.file when target is removed (#3488) * Fix deadlock that can happen when stopping reader tasks Co-authored-by: William Dumont <william.dumont@grafana.com> * fix: emit valid logfmt key (#3495) * Fix log keys to be valid for logfmt * Add changelog * Fix streams limit error check so that metrics are correctly labeled as `ReasonStreamLimited` (#3466) * fix: replace direct error string compare with isErrMaxStreamsLimitExceeded helper * update CHANGELOG * Make errMaxStreamsLimitExceeded an error type --------- Co-authored-by: Théo Brigitte <theo.brigitte@gmail.com> Co-authored-by: William Dumont <william.dumont@grafana.com> Co-authored-by: Marat Khvostov <marathvostov@gmail.com>
marctc
pushed a commit
that referenced
this pull request
May 7, 2025
…3451) * Fix mimir.rules.kubernetes to only return eventProcessor state if it exists * update CHANGELOG
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR Description
This PR fixes an issue where a panic occurs when trying to retrieve debug info for
mimir.rules.kubernetescomponent on non-leader instance. This is due to theeventProcessorbeing nil in this case.Which issue(s) this PR fixes
Fixes #3450 3450
Notes to the Reviewer
PR Checklist