Skip to content

Commit

Permalink
removed prometheusClient from expressionWithNoMetricName Validate
Browse files Browse the repository at this point in the history
  • Loading branch information
tizki committed Dec 6, 2023
1 parent eb4a730 commit 800a3af
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/validator/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,7 @@ func (e expressionWithNoMetricName) String() string {
return "expression with no metric name"
}

func (e expressionWithNoMetricName) Validate(rule rulefmt.Rule, prometheusClient *prometheus.Client) []error {
if prometheusClient == nil {
log.Error("missing the `prometheus` section of configuration for querying prometheus, skipping check that requires it...")
return nil
}
func (e expressionWithNoMetricName) Validate(rule rulefmt.Rule, _ *prometheus.Client) []error {
var errs []error
names, err := getExpressionMetricsNames(rule.Expr)
if err != nil {
Expand Down

0 comments on commit 800a3af

Please sign in to comment.