mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
refactor: use constant for prometheus datasource type (#78287)
This commit is contained in:
parent
25c2d99350
commit
2d2e058563
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||||
"github.com/grafana/grafana/pkg/infra/log"
|
"github.com/grafana/grafana/pkg/infra/log"
|
||||||
legacymodels "github.com/grafana/grafana/pkg/services/alerting/models"
|
legacymodels "github.com/grafana/grafana/pkg/services/alerting/models"
|
||||||
|
"github.com/grafana/grafana/pkg/services/datasources"
|
||||||
migmodels "github.com/grafana/grafana/pkg/services/ngalert/migration/models"
|
migmodels "github.com/grafana/grafana/pkg/services/ngalert/migration/models"
|
||||||
migrationStore "github.com/grafana/grafana/pkg/services/ngalert/migration/store"
|
migrationStore "github.com/grafana/grafana/pkg/services/ngalert/migration/store"
|
||||||
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
|
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||||
@ -235,7 +236,7 @@ func isPrometheusQuery(queryData map[string]json.RawMessage) (bool, error) {
|
|||||||
if datasource.Type == "" {
|
if datasource.Type == "" {
|
||||||
return false, fmt.Errorf("missing type field '%s'", string(ds))
|
return false, fmt.Errorf("missing type field '%s'", string(ds))
|
||||||
}
|
}
|
||||||
return datasource.Type == "prometheus", nil
|
return datasource.Type == datasources.DS_PROMETHEUS, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ruleAdjustInterval(freq int64) int64 {
|
func ruleAdjustInterval(freq int64) int64 {
|
||||||
|
Loading…
Reference in New Issue
Block a user