-
Notifications
You must be signed in to change notification settings - Fork 816
Ruler: Add support for per-user external labels #6340
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
Conversation
8551250
to
24be605
Compare
@rapphil @rajagopalanand Maybe u guys can take a look on this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. I think the change makes sense.
We still need some tests
r.deleteRuleCache(user) | ||
if err != nil { | ||
r.lastReloadSuccessful.WithLabelValues(user).Set(0) | ||
level.Error(r.logger).Log("msg", "unable to update rule manager", "user", user, "err", err) | ||
return | ||
} | ||
if externalLabelsUpdated { | ||
if err = r.notifierApplyExternalLabels(user, externalLabels); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a test case to verify the notifier applies external labels successfully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discovered alertmanagers will be reset after applying the config: prometheus/prometheus#14987
9d6bb66
to
8c543ae
Compare
not sure why the tests failed.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will continue to review today
Saw the same test failure in https://github.com/cortexproject/cortex/actions/runs/11944198449/job/33295615418?pr=6353 so probably unrelated. I will retry the test |
We can try rebasing master to get #6357 |
c518968
to
7b5b187
Compare
Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
53951fb
to
e4d2823
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just added one nit for idiomatic change
What this PR does:
Add support for per-user external labels, this currently applies only to alerting rules, but we may consider adding them to remote read in the future.
Which issue(s) this PR fixes:
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]