State explicitely what kind of timestamps are expected for the
--min-time and --max-time options of promtool tsdb commands.
This is especially important for the dump-openmetrics command as users
could otherwise mistakenly think it would be in seconds, like the
OpenMetrics timestamps themselves.
Signed-off-by: Nicolas Peugnet <nicolas.peugnet@lip6.fr>
tsdbDumpCmd:=tsdbCmd.Command("dump","Dump samples from a TSDB.")
dumpPath:=tsdbDumpCmd.Arg("db path","Database path (default is "+defaultDBPath+").").Default(defaultDBPath).String()
dumpSandboxDirRoot:=tsdbDumpCmd.Flag("sandbox-dir-root","Root directory where a sandbox directory will be created, this sandbox is used in case WAL replay generates chunks (default is the database path). The sandbox is cleaned up at the end.").String()
dumpMinTime:=tsdbDumpCmd.Flag("min-time","Minimum timestamp to dump.").Default(strconv.FormatInt(math.MinInt64,10)).Int64()
dumpMaxTime:=tsdbDumpCmd.Flag("max-time","Maximum timestamp to dump.").Default(strconv.FormatInt(math.MaxInt64,10)).Int64()
dumpMinTime:=tsdbDumpCmd.Flag("min-time","Minimum timestamp to dump, in milliseconds since the Unix epoch.").Default(strconv.FormatInt(math.MinInt64,10)).Int64()
dumpMaxTime:=tsdbDumpCmd.Flag("max-time","Maximum timestamp to dump, in milliseconds since the Unix epoch.").Default(strconv.FormatInt(math.MaxInt64,10)).Int64()
dumpMatch:=tsdbDumpCmd.Flag("match","Series selector. Can be specified multiple times.").Default("{__name__=~'(?s:.*)'}").Strings()
tsdbDumpOpenMetricsCmd:=tsdbCmd.Command("dump-openmetrics","[Experimental] Dump samples from a TSDB into OpenMetrics text format, excluding native histograms and staleness markers, which are not representable in OpenMetrics.")
dumpOpenMetricsPath:=tsdbDumpOpenMetricsCmd.Arg("db path","Database path (default is "+defaultDBPath+").").Default(defaultDBPath).String()
dumpOpenMetricsSandboxDirRoot:=tsdbDumpOpenMetricsCmd.Flag("sandbox-dir-root","Root directory where a sandbox directory will be created, this sandbox is used in case WAL replay generates chunks (default is the database path). The sandbox is cleaned up at the end.").String()
dumpOpenMetricsMinTime:=tsdbDumpOpenMetricsCmd.Flag("min-time","Minimum timestamp to dump.").Default(strconv.FormatInt(math.MinInt64,10)).Int64()
dumpOpenMetricsMaxTime:=tsdbDumpOpenMetricsCmd.Flag("max-time","Maximum timestamp to dump.").Default(strconv.FormatInt(math.MaxInt64,10)).Int64()
dumpOpenMetricsMinTime:=tsdbDumpOpenMetricsCmd.Flag("min-time","Minimum timestamp to dump, in milliseconds since the Unix epoch.").Default(strconv.FormatInt(math.MinInt64,10)).Int64()
dumpOpenMetricsMaxTime:=tsdbDumpOpenMetricsCmd.Flag("max-time","Maximum timestamp to dump, in milliseconds since the Unix epoch.").Default(strconv.FormatInt(math.MaxInt64,10)).Int64()
dumpOpenMetricsMatch:=tsdbDumpOpenMetricsCmd.Flag("match","Series selector. Can be specified multiple times.").Default("{__name__=~'(?s:.*)'}").Strings()
importCmd:=tsdbCmd.Command("create-blocks-from","[Experimental] Import samples from input and produce TSDB blocks. Please refer to the storage docs for more details.")
| <codeclass="text-nowrap">--sandbox-dir-root</code> | Root directory where a sandbox directory will be created, this sandbox is used in case WAL replay generates chunks (default is the database path). The sandbox is cleaned up at the end. | |
| <codeclass="text-nowrap">--min-time</code> | Minimum timestamp to dump. | `-9223372036854775808` |
| <codeclass="text-nowrap">--max-time</code> | Maximum timestamp to dump. | `9223372036854775807` |
| <codeclass="text-nowrap">--min-time</code> | Minimum timestamp to dump, in milliseconds since the Unix epoch. | `-9223372036854775808` |
| <codeclass="text-nowrap">--max-time</code> | Maximum timestamp to dump, in milliseconds since the Unix epoch. | `9223372036854775807` |
| <codeclass="text-nowrap">--match</code><codeclass="text-nowrap">...<codeclass="text-nowrap"> | Series selector. Can be specified multiple times. | `{__name__=~'(?s:.*)'}` |
@ -608,8 +608,8 @@ Dump samples from a TSDB.
| Flag | Description | Default |
| --- | --- | --- |
| <codeclass="text-nowrap">--sandbox-dir-root</code> | Root directory where a sandbox directory will be created, this sandbox is used in case WAL replay generates chunks (default is the database path). The sandbox is cleaned up at the end. | |
| <codeclass="text-nowrap">--min-time</code> | Minimum timestamp to dump. | `-9223372036854775808` |
| <codeclass="text-nowrap">--max-time</code> | Maximum timestamp to dump. | `9223372036854775807` |
| <codeclass="text-nowrap">--min-time</code> | Minimum timestamp to dump, in milliseconds since the Unix epoch. | `-9223372036854775808` |
| <codeclass="text-nowrap">--max-time</code> | Maximum timestamp to dump, in milliseconds since the Unix epoch. | `9223372036854775807` |
| <codeclass="text-nowrap">--match</code><codeclass="text-nowrap">...<codeclass="text-nowrap"> | Series selector. Can be specified multiple times. | `{__name__=~'(?s:.*)'}` |