mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove expr imports (#64543)
* Remove expr imports * Add comment
This commit is contained in:
parent
a5c5db3e91
commit
3cfb7ac0dd
@ -6,7 +6,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/expr"
|
||||
legacymodels "github.com/grafana/grafana/pkg/services/alerting/models"
|
||||
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
"github.com/grafana/grafana/pkg/tsdb/graphite"
|
||||
@ -180,7 +179,7 @@ func migrateAlertRuleQueries(data []alertQuery) ([]alertQuery, error) {
|
||||
result := make([]alertQuery, 0, len(data))
|
||||
for _, d := range data {
|
||||
// queries that are expression are not relevant, skip them.
|
||||
if d.DatasourceUID == expr.DatasourceType {
|
||||
if d.DatasourceUID == expressionDatasourceUID {
|
||||
result = append(result, d)
|
||||
continue
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/expr"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
@ -188,7 +187,7 @@ func transConditions(set dashAlertSettings, orgID int64, dsUIDMap dsUIDLookup) (
|
||||
ccAlertQuery := alertQuery{
|
||||
RefID: ccRefID,
|
||||
Model: exprModelJSON,
|
||||
DatasourceUID: expr.DatasourceUID,
|
||||
DatasourceUID: expressionDatasourceUID,
|
||||
}
|
||||
|
||||
newCond.Data = append(newCond.Data, ccAlertQuery)
|
||||
|
@ -43,6 +43,9 @@ var rmMigTitle = "remove unified alerting data"
|
||||
const clearMigrationEntryTitle = "clear migration entry %q"
|
||||
const codeMigration = "code migration"
|
||||
|
||||
// It is defined in pkg/expr/service.go as "DatasourceType"
|
||||
const expressionDatasourceUID = "__expr__"
|
||||
|
||||
type MigrationError struct {
|
||||
AlertId int64
|
||||
Err error
|
||||
|
Loading…
Reference in New Issue
Block a user