Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying storage.tsdb.retention in the config file rather than command line arg

Tags:

prometheus

Is there a way to specify storage.tsdb.retention flag in the config file rather than pass on the command line? I have different configuration files for different situations and it would be easier to manage if I can specify storage.tsdb.retention in the config file too.

like image 960
vrtx54234 Avatar asked Nov 09 '17 21:11

vrtx54234


People also ask

Where is Prometheus Tsdb stored?

Prometheus stores its on-disk time series data under the directory specified by the flag storage. local. path . The default path is ./data (relative to the working directory), which is good to try something out quickly but most likely not what you want for actual operations.

What is Prometheus retention?

By default the retention is configured to 15 days. The amounts of data stored on disk depends on retention — higher retention means more data on disk. The lowest supported retention in Prometheus is 2 hours (2h). Such a retention could be useful when configuring remote storage for Prometheus.

What is storage Tsdb Max Block duration?

tsdb. max-block-duration flags need to be set to the same value (two hours to match the default behavior), so that Prometheus local compaction is disabled.


1 Answers

There is no way to specify retention time except on the command line. Consider using envdir to have a config on the file system that can inject a value for retention time (via an environment variable) from on-disk configuration.

like image 175
remeika Avatar answered Sep 28 '22 09:09

remeika