Skip to content

Commit cce0fcd

Browse files
alchen1218chombium
authored andcommitted
add github.com/prometheus/common/model to scraper
1 parent dc0bd95 commit cce0fcd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pkg/scraper/scraper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
metrics "code.cloudfoundry.org/go-metric-registry"
1515
io_prometheus_client "github.com/prometheus/client_model/go"
1616
"github.com/prometheus/common/expfmt"
17+
"github.com/prometheus/common/model"
1718

1819
"code.cloudfoundry.org/go-loggregator/v9"
1920
)
@@ -177,7 +178,7 @@ func (s *Scraper) scrape(target Target) (map[string]*io_prometheus_client.Metric
177178
return nil, fmt.Errorf("unexpected status code %d: %s", resp.StatusCode, body)
178179
}
179180

180-
p := &expfmt.TextParser{}
181+
p := expfmt.NewTextParser(model.LegacyValidation)
181182
res, err := p.TextToMetricFamilies(resp.Body)
182183
if err != nil {
183184
return nil, err

0 commit comments

Comments
 (0)