Skip to content
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

Refactor mimir.rules.kubernetes component (port from agent repo) #158

Merged
merged 6 commits into from
Apr 22, 2024

Conversation

wildum
Copy link
Contributor

@wildum wildum commented Apr 9, 2024

I'm moving this PR to this repo

56quarters and others added 3 commits April 5, 2024 12:40
This change refactors the `mimir.rules.kubernetes` component to move most
mutable state into a separate `eventProcessor` struct. The existing code
already split most behavior between the main `rules.go` file and `events.go`
file. This takes the next logical step and wraps the state from `events.go`
into its own struct.

This is a prerequisite for a future PR that will add clustering support to
the `mimir.rules.kubernetes` component. In the future PR a particular agent
instance will be the "leader" for syncing rules from Mimir or not. When not
the leader, the `eventProcesor` will be a no-op.

Signed-off-by: Nick Pillitteri <[email protected]>
Signed-off-by: Nick Pillitteri <[email protected]>
Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

I added a few comments, but I'm happy for it to be merged as it is.

@wildum
Copy link
Contributor Author

wildum commented Apr 11, 2024

@56quarters Paulin left a few comments on your changes. I will let you decide how you want to handle these

@56quarters
Copy link
Contributor

@56quarters Paulin left a few comments on your changes. I will let you decide how you want to handle these

I'll take a look and push some changes, thanks!

Signed-off-by: Nick Pillitteri <[email protected]>
Signed-off-by: Nick Pillitteri <[email protected]>
@56quarters 56quarters requested a review from ptodev April 11, 2024 19:12
@rfratto rfratto added the backport-to-agent PR should be backported to the agent repo. label Apr 12, 2024
@ptodev ptodev self-assigned this Apr 18, 2024
@56quarters
Copy link
Contributor

I've made a few of the changes and provided an explanation for others. Can the Alloy team take another look at this PR?

@ptodev ptodev merged commit ae4b411 into main Apr 22, 2024
11 checks passed
@ptodev ptodev deleted the 56quarters/minimal-events branch April 22, 2024 09:43
hainenber pushed a commit to hainenber/alloy that referenced this pull request May 1, 2024
…fana#158)

* Refactor mimir.rules.kubernetes component

This change refactors the `mimir.rules.kubernetes` component to move most
mutable state into a separate `eventProcessor` struct. The existing code
already split most behavior between the main `rules.go` file and `events.go`
file. This takes the next logical step and wraps the state from `events.go`
into its own struct.

This is a prerequisite for a future PR that will add clustering support to
the `mimir.rules.kubernetes` component. In the future PR a particular agent
instance will be the "leader" for syncing rules from Mimir or not. When not
the leader, the `eventProcesor` will be a no-op.

Signed-off-by: Nick Pillitteri <[email protected]>

---------

Signed-off-by: Nick Pillitteri <[email protected]>
Co-authored-by: Nick Pillitteri <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport-to-agent PR should be backported to the agent repo. frozen-due-to-age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants