-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Correction of misleading help text(#5142) #7231
Conversation
Fixes #5142 Signed-off-by: arthursens <arthursens2005@gmail.com>
cmd/prometheus/main.go
Outdated
| @@ -204,7 +204,7 @@ func main() { | |||
| a.Flag("storage.tsdb.retention.time", "How long to retain samples in storage. When this flag is set it overrides \"storage.tsdb.retention\". If neither this flag nor \"storage.tsdb.retention\" nor \"storage.tsdb.retention.size\" is set, the retention time defaults to "+defaultRetentionString+". Units Supported: y, w, d, h, m, s, ms."). | |||
| SetValue(&newFlagRetentionDuration) | |||
|
|
|||
| a.Flag("storage.tsdb.retention.size", "[EXPERIMENTAL] Maximum number of bytes that can be stored for blocks. Units supported: KB, MB, GB, TB, PB. This flag is experimental and can be changed in future releases."). | |||
| a.Flag("storage.tsdb.retention.size", "[EXPERIMENTAL] Maximum number of bytes that can be stored for blocks. Make sure to specify the unit suffix. Ex: \"512MB\". Units supported: KB, MB, GB, TB, PB. This flag is experimental and can be changed in future releases."). | |||
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.
B is also supported.
The new text doesn't feel right. Maybe something like A unit is required, supported units:
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.
Be aware that a unit is required, supported units: B, KB, MB, GB, TB, PB. Ex: "512MB"
Is that ok?
Signed-off-by: arthursens <arthursens2005@gmail.com>
cmd/prometheus/main.go
Outdated
| @@ -204,7 +204,7 @@ func main() { | |||
| a.Flag("storage.tsdb.retention.time", "How long to retain samples in storage. When this flag is set it overrides \"storage.tsdb.retention\". If neither this flag nor \"storage.tsdb.retention\" nor \"storage.tsdb.retention.size\" is set, the retention time defaults to "+defaultRetentionString+". Units Supported: y, w, d, h, m, s, ms."). | |||
| SetValue(&newFlagRetentionDuration) | |||
|
|
|||
| a.Flag("storage.tsdb.retention.size", "[EXPERIMENTAL] Maximum number of bytes that can be stored for blocks. Make sure to specify the unit suffix. Ex: \"512MB\". Units supported: KB, MB, GB, TB, PB. This flag is experimental and can be changed in future releases."). | |||
| a.Flag("storage.tsdb.retention.size", "[EXPERIMENTAL] Maximum number of bytes that can be stored for blocks. Be aware that a unit is required, supported units: B, KB, MB, GB, TB, PB. Ex: \"512MB\". This flag is experimental and can be changed in future releases."). | |||
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.
No need for "Be aware that", it doesn't add anything.
|
Should we add EB too? |
|
If it's supported but missing, we should add it. |
|
And is EB supported? I am reading the code but can't seem to find anything on that If someone could show me where this flag is used on tsdb just so I can better understand the code... I would really appreciate it 😅 |
|
This handling all comes from upstream, which does have it: https://github.com/alecthomas/units/blob/master/bytes.go |
Added EB as supported unit in 'storage.tsdb.retention.size' help text, also com storage documentation Signed-off-by: arthursens <arthursens2005@gmail.com>
|
Thanks! |
|
thank you for your help in this pr |
* Correction of misleading help text(prometheus#5142) Signed-off-by: arthursens <arthursens2005@gmail.com>
It's my first PR to prometheus, so if I did anything wrong please tell me and I will be glad to fix any problem
Fixes #5142