Alerting: Use consts from alerting package (#61241)

This commit is contained in:
George Robinson
2023-01-10 19:59:13 +00:00
committed by GitHub
parent 2505f112f5
commit 2a291afbae
7 changed files with 31 additions and 35 deletions

View File

@@ -11,6 +11,7 @@ import (
prometheusModel "github.com/prometheus/common/model"
"go.opentelemetry.io/otel/attribute"
alertingModels "github.com/grafana/alerting/alerting/models"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/datasources"
@@ -517,9 +518,9 @@ func (sch *schedule) stopApplied(alertDefKey ngmodels.AlertRuleKey) {
func (sch *schedule) getRuleExtraLabels(evalCtx *evaluation) map[string]string {
extraLabels := make(map[string]string, 4)
extraLabels[ngmodels.NamespaceUIDLabel] = evalCtx.rule.NamespaceUID
extraLabels[alertingModels.NamespaceUIDLabel] = evalCtx.rule.NamespaceUID
extraLabels[prometheusModel.AlertNameLabel] = evalCtx.rule.Title
extraLabels[ngmodels.RuleUIDLabel] = evalCtx.rule.UID
extraLabels[alertingModels.RuleUIDLabel] = evalCtx.rule.UID
if !sch.disableGrafanaFolder {
extraLabels[ngmodels.FolderTitleLabel] = evalCtx.folderTitle