Merge pull request #2372 from aneagoe/master

rapl_collector: fix issue with invalid metric name (#2299)
This commit is contained in:
Ben Kochie 2022-05-31 21:42:50 +02:00 committed by GitHub
commit e22382c5ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,7 @@ func (c *raplCollector) Update(ch chan<- prometheus.Metric) error {
index := strconv.Itoa(rz.Index) index := strconv.Itoa(rz.Index)
descriptor := prometheus.NewDesc( 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", "Current RAPL "+rz.Name+" value in joules",
[]string{"index", "path"}, nil, []string{"index", "path"}, nil,
) )