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

Misleading help text for storage.tsdb.retention.size #5142

Open
acdha opened this Issue Jan 28, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@acdha
Copy link

acdha commented Jan 28, 2019

I installed 2.7.0 on a test server and ran into one point of confusion:

prometheus, version 2.7.0 (branch: HEAD, revision: 410ee9e04acb8f59f400858752ca82b4ef88035e)
  build user:       root@3bc81b516055
  build date:       20190128-10:09:51
  go version:       go1.11.5

The help text for --storage.tsdb.retention.size says this:

[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.

I interpreted that to mean that it followed the common convention of accepting a number as bytes while allowing units as a shortcut for readability. What it actually means is that you must specify one of the units or get an error like this:

Error parsing commandline arguments: units: unknown unit  in 96589578240b

It would be nice if it either defaulted to bytes or the wording was something like “Limit the maximum size of block storage. Specify the unit suffix using one of: KB, MB, GB, TB, PB.” to make it obvious that it's not optional.

@hphde

This comment has been minimized.

Copy link

hphde commented Jan 29, 2019

Mh. Worked for me though because it explicitly lists supported units and obviously bytes are not listed.

@acdha

This comment has been minimized.

Copy link
Author

acdha commented Jan 29, 2019

@hphde bytes are specified as the base unit in the previous sentence and most tools assume you're providing that value directly unless otherwise specified. For example, dd has this:

BLOCKS and BYTES may be followed by the following multiplicative suffixes: c =1, w =2, b =512, kB =1000, K =1024, MB =10001000, M =10241024, xM =M GB =100010001000, G =102410241024, and so on for T, P, E, Z, Y.

Perhaps that's really an argument saying that “unit” is the wrong term — the GNU utilities generally use “multiplicative suffix”:

Put size bytes of input into each output file. size may be, or may be an integer optionally followed by, one of the following multiplicative suffixes: …

https://www.gnu.org/software/coreutils/manual/html_node/split-invocation.html

A block size specification can be a positive integer specifying the number of bytes per block, or it can be human-readable or si to select a human-readable format. Integers may be followed by suffixes that are upward compatible with the SI prefixes for decimal multiples and with the ISO/IEC 80000-13 (formerly IEC 60027-2) prefixes for binary multiples.

https://www.gnu.org/software/coreutils/manual/html_node/Block-size.html#Block-size

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Mar 21, 2019

Ran into the same issue. Definitely 👍 for having bytes as default if no unit specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.