Chore: go.mod updates (#110957)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user