Skip to content

Fix mimir.rules.kubernetes panic on non-leader debug info retrieval#3451

Merged
dehaansa merged 2 commits intografana:mainfrom
TheoBrigitte:main
Apr 25, 2025
Merged

Fix mimir.rules.kubernetes panic on non-leader debug info retrieval#3451
dehaansa merged 2 commits intografana:mainfrom
TheoBrigitte:main

Conversation

@TheoBrigitte
Copy link
Contributor

@TheoBrigitte TheoBrigitte commented Apr 25, 2025

PR Description

This PR fixes an issue where a panic occurs when trying to retrieve debug info for mimir.rules.kubernetes component on non-leader instance. This is due to the eventProcessor being nil in this case.

Which issue(s) this PR fixes

Fixes #3450 3450

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated

@TheoBrigitte TheoBrigitte requested a review from a team as a code owner April 25, 2025 13:02
@CLAassistant
Copy link

CLAassistant commented Apr 25, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@dehaansa dehaansa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
}

Copy link
Contributor

@dehaansa dehaansa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be a flaky test in CI. Once I can get it to pass, I'll merge. Thanks for the fix!

@dehaansa dehaansa enabled auto-merge (squash) April 25, 2025 16:03
@dehaansa dehaansa merged commit fc9cff4 into grafana:main Apr 25, 2025
32 checks passed
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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty page and golang panic when trying to access mimir.rules.kubernetes component UI on a non-leader instances

4 participants