tsdb: default too small max block duration
This commit is contained in:
parent
d93273c4dc
commit
30e777d10d
|
@ -127,8 +127,7 @@ type Options struct {
|
||||||
// Open returns a new storage backed by a TSDB database that is configured for Prometheus.
|
// Open returns a new storage backed by a TSDB database that is configured for Prometheus.
|
||||||
func Open(path string, l log.Logger, r prometheus.Registerer, opts *Options) (*tsdb.DB, error) {
|
func Open(path string, l log.Logger, r prometheus.Registerer, opts *Options) (*tsdb.DB, error) {
|
||||||
if opts.MinBlockDuration > opts.MaxBlockDuration {
|
if opts.MinBlockDuration > opts.MaxBlockDuration {
|
||||||
return nil, errors.Errorf("tsdb max block duration (%v) must be larger than min block duration (%v)",
|
opts.MaxBlockDuration = opts.MinBlockDuration
|
||||||
opts.MaxBlockDuration, opts.MinBlockDuration)
|
|
||||||
}
|
}
|
||||||
// Start with smallest block duration and create exponential buckets until the exceed the
|
// Start with smallest block duration and create exponential buckets until the exceed the
|
||||||
// configured maximum block duration.
|
// configured maximum block duration.
|
||||||
|
|
Loading…
Reference in New Issue