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

pkg/reloader: remove mention of rule directories #3108

Merged

Conversation

simonpasquier
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

The reloader package doesn't care whether the watched directories
contain rule files or something else. This change removes the references
to "rule directories" and uses "watched directories" instead.

The motivation is that prometheus-operator use 2 reloaders:

  • prometheus-config-reloader that watches the Prometheus configuration file, it leverages the github.com/thanos-io/thanos/pkg/reloader package
  • configmap-reload that watches Prometheus rule files and Alertmanager configuration files, it is a separate project and implements its own logic to detect file changes.

Eventually we may consolidate and have only one reloader instance (presumably prometheus-config-reloader). Having to provide a RulesDir option to reload Alertmanager is slightly inconsistent.

Verification

No unit or e2e test added since there's no functional change.

@@ -220,10 +220,10 @@ func (r *Reloader) Watch(ctx context.Context) error {

r.watches.Set(float64(len(watchables)))
level.Info(r.logger).Log(
"msg", "started watching config file and recursively rule dirs for changes",
"msg", "started watching config file and recursively dirs for changes",
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
"msg", "started watching config file and recursively dirs for changes",
"msg", "started watching config file and directories recursively for changes",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I've removed recursively because the reloader doesn't watch directories recursively.

Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

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

lgtm :) one small note

The `reloader` package doesn't care whether the watched directories
contain rule files or something else. This change removes the references
to "rule directories" and uses "watched directories" instead.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

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

lgtm
re-running flaky test

@squat squat merged commit e239ef7 into thanos-io:master Sep 2, 2020
@simonpasquier simonpasquier deleted the update-reloader-option-for-dirs branch September 3, 2020 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants