--storage.tsdb.path="data/" 
Base path for metrics storage. Use with server mode only. 

--storage.tsdb.retention=STORAGE.TSDB.RETENTION [DEPRECATED] 
How long to retain samples in storage. This flag has been deprecated, use "storage.tsdb.retention.time" instead. Use with server mode only. 

--storage.tsdb.retention.time=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 15d. Units Supported: y, w, d, h, m, s, ms. Use with server mode only. 

--storage.tsdb.retention.size=STORAGE.TSDB.RETENTION.SIZE 
Maximum number of bytes that can be stored for blocks. A unit is required, supported units: B, KB, MB, GB, TB, PB, EB. Ex: "512MB". Based on powers-of-2, so 1KB is 1024B. Use with server mode only.
  • 通过 --help 可以找到有四个针对 tsdb 存储相关的参数
    • --storage.tsdb.pathprometheus 采集的指标存放的路径
    • --storage.tsdb.retention 已经被弃用了,官方让用 --storage.tsdb.retention.time 这个参数
    • --storage.tsdb.retention.time 是指定 prometheus 采集的指标存放时长,如果 --storage.tsdb.retention.size 参数没有被配置,默认就是 15天
    • --storage.tsdb.retention.size 是指定 prometheus 采集的指标达到最大存储大小,换算比例是 1:1024

03-08 00:57