-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat: allow loading rule-evaluator query options from config #1059
base: main
Are you sure you want to change the base?
Conversation
f235b4a
to
b6573e9
Compare
9487d00
to
f2a7f9a
Compare
f2a7f9a
to
efc2dc0
Compare
5d46346
to
f2f236b
Compare
74be4dd
to
d5b8f72
Compare
f1573e2
to
fd6303c
Compare
420e694
to
2a7865a
Compare
f1f97f8
to
515d45b
Compare
} | ||
|
||
return &evaluator, nil | ||
} | ||
|
||
func (e *ruleEvaluator) ApplyConfig(cfg *config.Config) error { | ||
func (e *ruleEvaluator) ApplyConfig(cfg *config.Config, evaluatorOpts *evaluatorOptions) error { | ||
if evaluatorOpts != nil && !reflect.DeepEqual(evaluatorOpts, e.lastEvaluatorOpts) { |
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.
This is a bit of work that could be replaced by simply detecting change AND os.Exit(0) (with clear log AND metric ideally, AND do this in main ofc).
This has consequence of tricky to debug if the "restart" was actual crash or consequence of valid config changes, but potentially it's fine?
cmd/rule-evaluator/main.go
Outdated
for { | ||
// Copy the rule-manager before running, so we don't hold the lock. | ||
e.mtx.Lock() | ||
oldRuleManager := e.rulesManager |
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.
I will think about perhaps if there's anything to simplify here
515d45b
to
bcc7f6a
Compare
2a7865a
to
3db475a
Compare
63d63a7
to
9d4a522
Compare
9d4a522
to
70b228c
Compare
Pre-req: #1104
The following are now settable in the rule-evaluator Prometheus config:
When both CLI arguments and configurations are present, the CLI arguments will be the default and the set configurations will override the CLI arguments.