fix(agent): add fallback for CPU model detection on MIPS architectures (#2138)

gopsutil's cpu.Info() does not parse the 'cpu model' field from
/proc/cpuinfo, which is the only source of CPU model names on MIPS.
Add a fallback that reads /proc/cpuinfo directly and combines
'cpu model' (e.g. 'MIPS 1004Kc V2.15') with 'system type'
(e.g. 'MediaTek MT7621 ver:1 eco:3') for a complete identifier.

The fallback only triggers when gopsutil returns an empty ModelName,
so x86/ARM/other architectures are unaffected.
This commit is contained in:
Jan Dziąsło
2026-08-18 16:34:41 +02:00
committed by GitHub
parent 65a6f60304
commit 96beadc8c9
3 changed files with 142 additions and 0 deletions

View File

@@ -50,6 +50,9 @@ func generateFingerprint(hostname, cpuModel string) string {
if info, err := cpu.Info(); err == nil && len(info) > 0 {
cpuModel = info[0].ModelName
}
if cpuModel == "" {
cpuModel = getCpuModelFromCpuinfo()
}
}
fingerprint = hostname + cpuModel
}