ncabatoff / process-exporter

Prometheus exporter that mines /proc to report on selected processes
MIT License
1.72k stars 270 forks source link

Fix on 32bit arch #210

Closed c0va23 closed 3 years ago

c0va23 commented 3 years ago

Hi, latest version (0.7.8) of this exporter cannot collect proc stat on armv6 (and posible on all other 32 bit platform). Its bug into currently used procfs package, but in last version bug fixed.

Updating procfs package fix this exporter for 32 bit platforms. I tested fix on my armv7 device, after this patch - exporter start working.

This changes fix bug: https://github.com/prometheus/procfs/compare/v0.7.1...v0.7.3#diff-a1d7bdae8a86539cbde035eaa8ddef778467c826d849ac33a4ec56b067091695R130-R183

Logs before path:

Oct 31 10:43:18 radxa.lan process-exporter[3950]: 2021/10/31 10:43:18 error getting proc ID for pid 613: integer overflow on token 3069030400
Oct 31 10:43:18 radxa.lan process-exporter[3950]: 2021/10/31 10:43:18 error getting proc ID for pid 614: integer overflow on token 3069030400
Oct 31 10:43:18 radxa.lan process-exporter[3950]: 2021/10/31 10:43:18 error getting proc ID for pid 615: integer overflow on token 3069030400

Logs after path:

Oct 31 10:44:20 radxa.lan process-exporter[4362]: 2021/10/31 10:44:20 found new proc: {Pid:1 StartTimeRel:4}:{Name:systemd Cmdline:[/sbi
n/init] Cgroups:[/ / / /init.scope] ParentPid:0 StartTime:2021-10-19 23:48:53.04 +0000 UTC EffectiveUID:0}
Oct 31 10:44:20 radxa.lan process-exporter[4362]: 2021/10/31 10:44:20 found new proc: {Pid:2 StartTimeRel:4}:{Name:kthreadd Cmdline:[] C
groups:[/ / / /] ParentPid:0 StartTime:2021-10-19 23:48:53.04 +0000 UTC EffectiveUID:0}
Oct 31 10:44:20 radxa.lan process-exporter[4362]: 2021/10/31 10:44:20 found new proc: {Pid:3 StartTimeRel:8}:{Name:ksoftirqd/0 Cmdline:[
] Cgroups:[/ / / /] ParentPid:2 StartTime:2021-10-19 23:48:53.08 +0000 UTC EffectiveUID:0}
ncabatoff commented 3 years ago

Thanks @c0va23 ! v0.7.9 contains this fix.