From 0ea3a2218d3a71d7a721c078efa2919175beb7a4 Mon Sep 17 00:00:00 2001 From: Brooks Swinnerton Date: Sat, 30 Nov 2019 03:00:51 -0500 Subject: [PATCH] Add time units to storage.tsdb.retention.size flag (#6365) * Add time units to storage.tsdb.retention.size flag In an effort to reduce confusion with the `m` option of the `ParseDuration()` function, this commit adds the available time units to the `storage.tsdb.retention.time` flag to help showcase that there is no option for months (which could be assumed to be `m`). If someone were looking to set the retention to six months, they may mistakenly do so with `6m`, which would reduce their retention to six minutes. Signed-off-by: Brooks Swinnerton --- cmd/prometheus/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index b1cc3fb8cb..00ec8eee6a 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -195,7 +195,7 @@ func main() { a.Flag("storage.tsdb.retention", "[DEPRECATED] How long to retain samples in storage. This flag has been deprecated, use \"storage.tsdb.retention.time\" instead."). SetValue(&oldFlagRetentionDuration) - 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+"."). + 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.").