From 0e320e725b5e2f9092b95f4d9f640ff08cf61683 Mon Sep 17 00:00:00 2001 From: Andrei Neagoe <3854672+aneagoe@users.noreply.github.com> Date: Mon, 9 May 2022 15:42:46 +0200 Subject: [PATCH] rapl_collector: fix issue with invalid metric name (#2299) Signed-off-by: Andrei Neagoe <3854672+aneagoe@users.noreply.github.com> --- collector/rapl_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/rapl_linux.go b/collector/rapl_linux.go index 5ed343bb..4fc566cc 100644 --- a/collector/rapl_linux.go +++ b/collector/rapl_linux.go @@ -80,7 +80,7 @@ func (c *raplCollector) Update(ch chan<- prometheus.Metric) error { index := strconv.Itoa(rz.Index) descriptor := prometheus.NewDesc( - prometheus.BuildFQName(namespace, "rapl", rz.Name+"_joules_total"), + prometheus.BuildFQName(namespace, "rapl", SanitizeMetricName(rz.Name+"_joules_total")), "Current RAPL "+rz.Name+" value in joules", []string{"index", "path"}, nil, )