Commit 6b0f56b7 by Ryan McKinley Committed by GitHub

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

parent 5520cd2c
...@@ -83,6 +83,12 @@ func getQueryModelTSDB(query *tsdb.Query, timeRange *tsdb.TimeRange, dsInfo *mod ...@@ -83,6 +83,12 @@ func getQueryModelTSDB(query *tsdb.Query, timeRange *tsdb.TimeRange, dsInfo *mod
To: endTime, To: endTime,
} }
model.MaxDataPoints = query.MaxDataPoints 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) model.Interval = time.Millisecond * time.Duration(query.IntervalMs)
if model.Interval.Milliseconds() == 0 {
model.Interval = time.Millisecond // 1ms
}
return model, nil return model, nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment