restruct code

Signed-off-by: Xuhui Zhu <simon.zhu@canonical.com>
This commit is contained in:
Xuhui Zhu 2024-08-23 16:34:23 -04:00 committed by Johannes 'fish' Ziemke
parent 6f3c345632
commit 89a21a9c4c

View File

@ -360,7 +360,7 @@ func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) er
if sensorType == "freq" && element == "input" {
if label, ok := sensorData["label"]; ok {
sensorLabel := cleanMetricName(label)
desc := prometheus.NewDesc("node_hwmon_freq_hertz", "Hardware monitor for GPU frequency in MHz", hwmonLabelDesc, nil)
desc := prometheus.NewDesc(name+"_freq_mhz", "Hardware monitor for GPU frequency in MHz", hwmonLabelDesc, nil)
ch <- prometheus.MustNewConstMetric(
desc, prometheus.GaugeValue, parsedValue/1000000.0, append(labels[:len(labels)-1], sensorLabel)...)
}