From 74a22daa49f6dd2e06f7668d761a2fa967a913f8 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 8 Dec 2022 23:24:39 +0000 Subject: [PATCH] [v9.3.x] Alerting: Use the QuotaTargetSrv instead of the QuotaTarget in quota check (#60034) Alerting: Use the QuotaTargetSrv instead of the QuotaTarget in quota check (#60026) Before this change, the alerting provisioning system incorrectly used the QuotaTarget to check if alerting's request quota had been reached. The quota service requires the QuotaTargetSrv, which is what's registered with the service at startup time. This is leading to errors in the provisioning system. (cherry picked from commit e6743a7e9a33ca5772656c8fa34ae6c1f02adebe) Co-authored-by: Joe Blubaugh --- pkg/services/ngalert/provisioning/alert_rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/ngalert/provisioning/alert_rules.go b/pkg/services/ngalert/provisioning/alert_rules.go index 429d76526c0..f360deed48f 100644 --- a/pkg/services/ngalert/provisioning/alert_rules.go +++ b/pkg/services/ngalert/provisioning/alert_rules.go @@ -318,7 +318,7 @@ func (service *AlertRuleService) DeleteAlertRule(ctx context.Context, orgID int6 // checkLimitsTransactionCtx checks whether the current transaction (as identified by the ctx) breaches configured alert rule limits. func (service *AlertRuleService) checkLimitsTransactionCtx(ctx context.Context, orgID, userID int64) error { - limitReached, err := service.quotas.CheckQuotaReached(ctx, "alert_rule", "a.ScopeParameters{ + limitReached, err := service.quotas.CheckQuotaReached(ctx, models.QuotaTargetSrv, "a.ScopeParameters{ OrgID: orgID, UserID: userID, })