diff --git a/pkg/services/ngalert/api/api_prometheus_test.go b/pkg/services/ngalert/api/api_prometheus_test.go index 4e9c226e30f..4bf06b8b4a4 100644 --- a/pkg/services/ngalert/api/api_prometheus_test.go +++ b/pkg/services/ngalert/api/api_prometheus_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + alertingModels "github.com/grafana/alerting/alerting/models" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/models" acmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock" @@ -525,9 +526,9 @@ func generateRuleAndInstanceWithQuery(t *testing.T, orgID int64, fakeAIM *fakeAl fakeAIM.GenerateAlertInstances(orgID, rules[0].UID, 1, func(s *state.State) *state.State { s.Labels = data.Labels{ - "job": "prometheus", - ngmodels.NamespaceUIDLabel: "test_namespace_uid", - ngmodels.RuleUIDLabel: "test_alert_rule_uid_0", + "job": "prometheus", + alertingModels.NamespaceUIDLabel: "test_namespace_uid", + alertingModels.RuleUIDLabel: "test_alert_rule_uid_0", } s.Annotations = data.Labels{"severity": "critical"} return s @@ -548,7 +549,7 @@ func asFixture() func(r *ngmodels.AlertRule) { r.UID = "RuleUID" r.Labels = map[string]string{ "__a_private_label_on_the_rule__": "a_value", - ngmodels.RuleUIDLabel: "RuleUID", + alertingModels.RuleUIDLabel: "RuleUID", } r.Annotations = nil r.IntervalSeconds = 60 diff --git a/pkg/services/ngalert/models/alert_rule.go b/pkg/services/ngalert/models/alert_rule.go index 872833941ba..884b59516fa 100644 --- a/pkg/services/ngalert/models/alert_rule.go +++ b/pkg/services/ngalert/models/alert_rule.go @@ -12,6 +12,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + alertingModels "github.com/grafana/alerting/alerting/models" "github.com/grafana/grafana/pkg/services/quota" "github.com/grafana/grafana/pkg/util/cmputil" ) @@ -89,17 +90,9 @@ const ( ) const ( - RuleUIDLabel = "__alert_rule_uid__" - NamespaceUIDLabel = "__alert_rule_namespace_uid__" - // Annotations are actually a set of labels, so technically this is the label name of an annotation. DashboardUIDAnnotation = "__dashboardUid__" PanelIDAnnotation = "__panelId__" - OrgIDAnnotation = "__orgId__" - - // This isn't a hard-coded secret token, hence the nolint. - //nolint:gosec - ImageTokenAnnotation = "__alertImageToken__" // GrafanaReservedLabelPrefix contains the prefix for Grafana reserved labels. These differ from "__