Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/kubernetes/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
"github.com/prometheus/common/model"
api "k8s.io/api/core/v1"
discovery "k8s.io/api/discovery/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -85,7 +84,11 @@ func testEndpoints(t *testing.T, client *kubernetes.Clientset, slices bool) {

// scrape and parse metrics to get base state
m := ScrapeMetrics(t)
tp := expfmt.NewTextParser(model.LegacyValidation)
// prometheus/common v0.59.1 (pinned in go.mod) does not yet expose
// NewTextParser; stick with the zero-value TextParser, which
// defaults to legacy validation, until coredns/coredns#7731 bumps
// the common dep.
var tp expfmt.TextParser
base, err := tp.TextToMetricFamilies(strings.NewReader(string(m)))
if err != nil {
t.Fatalf("Could not parse scraped metrics: %v", err)
Expand Down