{"record":{"id":"93d7dbd83d646645","repo":"prometheus/node_exporter","slug":"could-not-derive-a-monitoring-name-for","errorCode":null,"errorMessage":"Could not derive a monitoring name for ","messagePattern":"Could not derive a monitoring name for ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/hwmon_linux.go","lineNumber":414,"sourceCode":"\t\t\treturn cleanName, nil\n\t\t}\n\t}\n\n\t// it looks bad, name and device don't provide enough information\n\t// return a hwmon[0-9]* name\n\n\trealDir, err := filepath.EvalSymlinks(dir)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// take the last path element, this will be hwmonX\n\t_, name := filepath.Split(realDir)\n\tcleanName := cleanMetricName(name)\n\tif cleanName != \"\" {\n\t\treturn cleanName, nil\n\t}\n\treturn \"\", errors.New(\"Could not derive a monitoring name for \" + dir)\n}\n\n// hwmonHumanReadableChipName is similar to the methods in hwmonName, but with\n// different precedences -- we can allow duplicates here.\nfunc (c *hwMonCollector) hwmonHumanReadableChipName(dir string) (string, error) {\n\tsysnameRaw, nameErr := os.ReadFile(filepath.Join(dir, \"name\"))\n\tif nameErr != nil {\n\t\treturn \"\", nameErr\n\t}\n\n\tif string(sysnameRaw) != \"\" {\n\t\tcleanName := cleanMetricName(string(sysnameRaw))\n\t\tif cleanName != \"\" {\n\t\t\treturn cleanName, nil\n\t\t}\n\t}\n\n\treturn \"\", errors.New(\"Could not derive a human-readable chip type for \" + dir)","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/hwmon_linux.go#L396-L432","documentation":"hwmonName could not build a readable chip name for the hwmon device at the given sysfs directory: neither the device's name file nor the device name yielded a usable metric name, and even the fallback hwmonX directory name cleaned to an empty string. This happens for hwmon entries with missing or empty name attributes under /sys/class/hwmon.","triggerScenarios":"Thrown at collector/hwmon_linux.go:414 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the directory: `cat /sys/class/hwmon/hwmonX/name` and `readlink /sys/class/hwmon/hwmonX/device`; a missing/empty name indicates a driver or hardware issue.","Update the kernel/driver so the hwmon device exposes a proper name attribute.","Disable the hwmon collector (--collector.hwmon) if the broken device cannot be fixed and its metrics are not needed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}