-
Notifications
You must be signed in to change notification settings - Fork 535
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
Server flags categorization #1125
Conversation
|
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.
You picked a smart solution, good job! I just left a comment about 1 categorization.
@@ -19,7 +19,7 @@ const ( | |||
|
|||
type Config struct { | |||
// Enabled switches on support for multi tenant query federation | |||
Enabled bool `yaml:"enabled"` | |||
Enabled bool `yaml:"enabled" category:"advanced"` |
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 don't think this should be advanced, because this is a core (stable) feature. I left the same comment in a previous PR that was proposing to flag it as advanced.
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 changed the spreadsheet so hopefully it doesn't happen again.
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.
Nice!
"server.register-instrumentation": Advanced, | ||
} | ||
|
||
func GetOverride(fieldName string) (category Category, ok bool) { |
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 also include a check to verify that all options from overrides
map were actually used? This is to avoid having obsolete flags here.
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 think that would be helpful and have been trying to think of the best way to do something like this. Maybe a usage_test.go? I'll try to see if I can make something work.
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'm going to merge this PR, since having this classification is very important. I would be glad if you could follow up with your test is a separate PR. An idea to test it is to check if all flags referenced here are included in cmd/mimir/help-all.txt.tmpl
(maybe you have a smarter idea, otherwise you could fallback to this).
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'll be sure to do the test still in another PR, thanks.
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 opened #1164 to make sure I don't forget about this.
What this PR does:
Categorizes flags as advanced for server flags and the tenant federation flag.
The server flags were tricky because the struct fields couldn't be tagged directly.
server.Config
is inweaveworks/common
, which also contained structs fromprometheus/exporter-toolkit
. Instead of replicating the structs, I introduced an override mechanism to contain flag classification issues and provide an easier pathway for anyone else dealing with this issue in the future.Which issue(s) this PR fixes:
N/A
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]