mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
prom: add support for default step param (#9866)
Alerting for prometheus have been depending on the step parameter from each query. In https://github.com/grafana/grafana/pull/9226 we changed the behavior for step in the frontend which caused problems for alerting. This commit fixes that by introducing a default min interval value so alerting always have something to depend on. closes #9777
This commit is contained in:
@@ -2,6 +2,7 @@ package influxdb
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
@@ -115,7 +116,7 @@ func TestInfluxdbQueryParser(t *testing.T) {
|
||||
So(len(res.GroupBy), ShouldEqual, 3)
|
||||
So(len(res.Selects), ShouldEqual, 3)
|
||||
So(len(res.Tags), ShouldEqual, 2)
|
||||
So(res.Interval, ShouldEqual, ">20s")
|
||||
So(res.Interval, ShouldEqual, time.Second*20)
|
||||
So(res.Alias, ShouldEqual, "serie alias")
|
||||
})
|
||||
|
||||
@@ -174,7 +175,7 @@ func TestInfluxdbQueryParser(t *testing.T) {
|
||||
So(len(res.GroupBy), ShouldEqual, 2)
|
||||
So(len(res.Selects), ShouldEqual, 1)
|
||||
So(len(res.Tags), ShouldEqual, 0)
|
||||
So(res.Interval, ShouldEqual, ">10s")
|
||||
So(res.Interval, ShouldEqual, time.Second*10)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user