Chore: go.mod updates (#110957)

This commit is contained in:
Ryan McKinley
2025-09-15 09:01:45 +00:00
committed by GitHub
parent f73cb477cb
commit afc08dbbbc
38 changed files with 240 additions and 149 deletions
@@ -182,7 +182,7 @@ func validateRecordingRuleFields(in *apimodels.PostableExtendedRuleNode, newRule
if !metricName.IsValid() {
return ngmodels.AlertRule{}, fmt.Errorf("%w: %s", ngmodels.ErrAlertRuleFailedValidation, "metric name for recording rule must be a valid utf8 string")
}
if !prommodels.IsValidMetricName(metricName) {
if !prommodels.IsValidMetricName(metricName) { // nolint:staticcheck
return ngmodels.AlertRule{}, fmt.Errorf("%w: %s", ngmodels.ErrAlertRuleFailedValidation, "metric name for recording rule must be a valid Prometheus metric name")
}
newRule.Record = ModelRecordFromApiRecord(in.GrafanaManagedAlert.Record)
+3 -2
View File
@@ -18,9 +18,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/grafana/grafana-plugin-sdk-go/data"
prommodels "github.com/prometheus/common/model"
"github.com/grafana/grafana-plugin-sdk-go/data"
alertingModels "github.com/grafana/alerting/models"
"github.com/grafana/grafana/pkg/services/folder"
@@ -783,7 +784,7 @@ func validateRecordingRuleFields(rule *AlertRule) error {
if !metricName.IsValid() {
return errors.New("metric name for recording rule must be a valid utf8 string")
}
if !prommodels.IsValidMetricName(metricName) {
if !prommodels.IsValidMetricName(metricName) { // nolint:staticcheck
return errors.New("metric name for recording rule must be a valid Prometheus metric name")
}