InfluxDB: Alerting issue, reasonable defaults for interval and maxDataPoints (#27463)

This commit is contained in:
Ryan McKinley
2020-09-09 00:34:17 -07:00
committed by GitHub
parent 5520cd2c68
commit 6b0f56b726

View File

@@ -83,6 +83,12 @@ func getQueryModelTSDB(query *tsdb.Query, timeRange *tsdb.TimeRange, dsInfo *mod
To: endTime,
}
model.MaxDataPoints = query.MaxDataPoints
if model.MaxDataPoints == 0 {
model.MaxDataPoints = 10000 // 10k/series should be a reasonable place to abort!
}
model.Interval = time.Millisecond * time.Duration(query.IntervalMs)
if model.Interval.Milliseconds() == 0 {
model.Interval = time.Millisecond // 1ms
}
return model, nil
}