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

implement ApplyConfig for pkg/prom #473

Merged
merged 2 commits into from
Mar 17, 2021
Merged

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Mar 17, 2021

PR Description

Implements ApplyConfig for pkg/prom.Agent.

Which issue(s) this PR fixes

Related to #147.

Notes to the Reviewer

Alternative implementation of #435.

I don't really like how this works, and needing to have a goroutine to apply changed configs in the background feels bad. I've given some thought on other ways to do this, but this seems like the less ridiculous so far.

PR Checklist

  • CHANGELOG updated
  • Documentation added
  • Tests updated

@rfratto rfratto requested a review from mattdurham March 17, 2021 19:45
// because creating both this function and newInstance grab the mutex.
oldConfig := a.cfg

a.actor <- func() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

As you mentioned this feels less than ideal. This is fine if this is the best way to go forward given the situation, but feels like something we may have to pay off later.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm thinking about it some more and we'll eventually be able to get rid of it once we consolidate the operational modes here and make the Agent always act as if it was clustered. We'd have a configstore.Local implementation and the config watcher would continue to sync the state with the local store in the background. It's still not great that it'll always be asynchronous. Maybe once we make that change another opportunity to simplify will pop up 🤞

@rfratto rfratto merged commit c63a8cd into grafana:main Mar 17, 2021
@rfratto rfratto deleted the prom-applyconfig branch March 17, 2021 21:01
@mattdurham mattdurham mentioned this pull request Sep 7, 2021
3 tasks
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
* implement ApplyConfig for pkg/prom

* clean up comments
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Apr 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants