From 6b0f56b726263b28d4462dd0c301754512b7e74f Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Wed, 9 Sep 2020 00:34:17 -0700 Subject: [PATCH] InfluxDB: Alerting issue, reasonable defaults for interval and maxDataPoints (#27463) --- pkg/tsdb/influxdb/flux/query_models.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/tsdb/influxdb/flux/query_models.go b/pkg/tsdb/influxdb/flux/query_models.go index 093d264a2f2..e1be9971b14 100644 --- a/pkg/tsdb/influxdb/flux/query_models.go +++ b/pkg/tsdb/influxdb/flux/query_models.go @@ -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 }