From 1a8ea78207af44d2e26c53a55341687b859340d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 16 Nov 2023 13:16:47 +0000 Subject: [PATCH] Fix BenchmarkScrapeLoopAppendOM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenMetrics requires EOF comment at the end of metrics body, but the makeTestMetrics() function doesn't append it. This means this benchmark tests a response with errors but I don't think that was the intention. Signed-off-by: Ɓukasz Mierzwa --- scrape/scrape_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index bcaeb460e..e37d091ae 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -1068,6 +1068,7 @@ func makeTestMetrics(n int) []byte { 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") return sb.Bytes() }