mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
Merge pull request #2713 from brancz/max-block-duration-default
prometheus: default max-block-duration to 10% of retention
This commit is contained in:
commit
d1d5c5c47d
@ -134,8 +134,8 @@ func init() {
|
||||
"Minimum duration of a data block before being persisted.",
|
||||
)
|
||||
cfg.fs.DurationVar(
|
||||
&cfg.tsdb.MaxBlockDuration, "storage.tsdb.max-block-duration", 36*time.Hour,
|
||||
"Maximum duration compacted blocks may span.",
|
||||
&cfg.tsdb.MaxBlockDuration, "storage.tsdb.max-block-duration", 0,
|
||||
"Maximum duration compacted blocks may span. (Defaults to 10% of the retention period)",
|
||||
)
|
||||
cfg.fs.IntVar(
|
||||
&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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user