Fix global ref

This commit is contained in:
matt durham 2023-10-02 15:51:27 -04:00
parent d9683215e7
commit 7bc164fbe7
No known key found for this signature in database
GPG key ID: A62E920AE398897B

View file

@ -208,10 +208,6 @@ func (c *cpuCollector) updateInfo(ch chan<- prometheus.Metric) error {
cpu.CacheSize) cpu.CacheSize)
} }
cpuFreqEnabled, ok := collectorState["cpufreq"]
if !ok || cpuFreqEnabled == nil {
level.Debug(c.logger).Log("cpufreq key missing or nil value in collectorState map", err)
} else if !*cpuFreqEnabled {
for _, cpu := range info { for _, cpu := range info {
ch <- prometheus.MustNewConstMetric(c.cpuFrequencyHz, ch <- prometheus.MustNewConstMetric(c.cpuFrequencyHz,
prometheus.GaugeValue, prometheus.GaugeValue,
@ -220,7 +216,6 @@ func (c *cpuCollector) updateInfo(ch chan<- prometheus.Metric) error {
cpu.CoreID, cpu.CoreID,
strconv.Itoa(int(cpu.Processor))) strconv.Itoa(int(cpu.Processor)))
} }
}
if len(info) != 0 { if len(info) != 0 {
cpu := info[0] cpu := info[0]