From ff16fa1827fee0d903978a01b76b2cead0ea3df9 Mon Sep 17 00:00:00 2001 From: huochexizhan Date: Thu, 10 Oct 2024 16:14:40 +0800 Subject: [PATCH] fix: fix slice init length Signed-off-by: huochexizhan --- scrape/scrape.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrape/scrape.go b/scrape/scrape.go index 071edfca5f..119f482484 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -1556,7 +1556,7 @@ func (sl *scrapeLoop) append(app storage.Appender, b []byte, contentType string, metadataChanged bool ) - exemplars := make([]exemplar.Exemplar, 1) + exemplars := make([]exemplar.Exemplar, 0, 1) // updateMetadata updates the current iteration's metadata object and the // metadataChanged value if we have metadata in the scrape cache AND the