diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index be81b8677c..213811784c 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -1067,9 +1067,9 @@ func TestScrapeLoopFailWithInvalidLabelsAfterRelabel(t *testing.T) { func makeTestMetrics(n int) []byte { // Construct a metrics string to parse sb := bytes.Buffer{} + fmt.Fprintf(&sb, "# TYPE metric_a gauge\n") + fmt.Fprintf(&sb, "# HELP metric_a help text\n") for i := 0; i < n; i++ { - fmt.Fprintf(&sb, "# TYPE metric_a gauge\n") - fmt.Fprintf(&sb, "# HELP metric_a help text\n") fmt.Fprintf(&sb, "metric_a{foo=\"%d\",bar=\"%d\"} 1\n", i, i*100) } fmt.Fprintf(&sb, "# EOF\n")