prometheus: default max-block-duration to 10% of retention

This commit is contained in:
Frederic Branczyk 2017-05-12 11:48:51 +02:00
parent 8e73bde650
commit c50a3eccce
No known key found for this signature in database
GPG Key ID: CA14788B1E48B256
1 changed files with 6 additions and 2 deletions

View File

@ -134,8 +134,8 @@ func init() {
"Minimum duration of a data block before being persisted.", "Minimum duration of a data block before being persisted.",
) )
cfg.fs.DurationVar( cfg.fs.DurationVar(
&cfg.tsdb.MaxBlockDuration, "storage.tsdb.max-block-duration", 36*time.Hour, &cfg.tsdb.MaxBlockDuration, "storage.tsdb.max-block-duration", 0,
"Maximum duration compacted blocks may span.", "Maximum duration compacted blocks may span. (Defaults to 10% of the retention period)",
) )
cfg.fs.IntVar( cfg.fs.IntVar(
&cfg.tsdb.AppendableBlocks, "storage.tsdb.appendable-blocks", 2, &cfg.tsdb.AppendableBlocks, "storage.tsdb.appendable-blocks", 2,
@ -210,6 +210,10 @@ func parse(args []string) error {
} }
} }
if cfg.tsdb.MaxBlockDuration == 0 {
cfg.tsdb.MaxBlockDuration = cfg.tsdb.Retention / 10
}
return nil return nil
} }