Prometheus: remove scope dependency (#84991)
* Prometheus: remove scope dependency temp workaround * depguard * comment * remove rules since they need a newer version of golangci-lint --------- Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
This commit is contained in:
co-authored by
ismail simsek
parent
2f7fd729ef
commit
86a2a1a19b
@@ -3,12 +3,11 @@ package models
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apis/scope/v0alpha1"
|
||||
"github.com/prometheus/prometheus/model/labels"
|
||||
"github.com/prometheus/prometheus/promql/parser"
|
||||
)
|
||||
|
||||
func ApplyQueryScope(rawExpr string, scope v0alpha1.ScopeSpec) (string, error) {
|
||||
func ApplyQueryScope(rawExpr string, scope ScopeSpec) (string, error) {
|
||||
expr, err := parser.ParseExpr(rawExpr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -59,7 +58,7 @@ func ApplyQueryScope(rawExpr string, scope v0alpha1.ScopeSpec) (string, error) {
|
||||
return expr.String(), nil
|
||||
}
|
||||
|
||||
func scopeFiltersToMatchers(filters []v0alpha1.ScopeFilter) ([]*labels.Matcher, error) {
|
||||
func scopeFiltersToMatchers(filters []ScopeFilter) ([]*labels.Matcher, error) {
|
||||
matchers := make([]*labels.Matcher, 0, len(filters))
|
||||
for _, f := range filters {
|
||||
var mt labels.MatchType
|
||||
|
||||
Reference in New Issue
Block a user