memory: fix panics if metrics does not exists (#1960)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>

(cherry picked from commit ecc805f0fa)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2025-04-04 23:21:26 +02:00
parent b62c724977
commit fe17f5f597
39 changed files with 576 additions and 399 deletions

View File

@@ -47,7 +47,7 @@ func FuncBenchmarkCollector[C collector.Collector](b *testing.B, name string, co
}
collectors := collector.New(map[string]collector.Collector{name: c})
require.NoError(b, collectors.Build(logger))
require.NoError(b, collectors.Build(b.Context(), logger))
metrics := make(chan prometheus.Metric)