prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
11.03k stars 2.34k forks source link

ref!: convert linux meminfo implementation to use procfs lib #3049

Closed tjhop closed 2 months ago

tjhop commented 3 months ago

Part of #2957

Prometheus' procfs lib supports collecting memory info and we're using a new enough version of the lib that has it available, so this converts the meminfo collector for Linux to use data from procfs lib instead. The bits I've touched for darwin/openbsd/netbsd are with intent to preserve the original struct implementation/backwards compatibility.

Signed-off-by: TJ Hoplock t.hoplock@gmail.com

tjhop commented 3 months ago

Looking at the failing tests

tjhop commented 3 months ago

@SuperQ would you mind taking a look when you get time? Lemme know your thoughts :+1:

tjhop commented 3 months ago

Ah, good point, I appreciate the forethought. I'll rework it to not coerce nils and leave them out :+1:

tjhop commented 3 months ago

@SuperQ is this more in line with what you were thinking?

SuperQ commented 3 months ago

Yes, this is looking much better. I'll try and do a deeper review soon.

tjhop commented 3 months ago

Friendly bump. @SuperQ please lemme know if you have any further thoughts 👍