-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref!: convert linux meminfo implementation to use procfs lib #3049
base: master
Are you sure you want to change the base?
Conversation
Looking at the failing tests |
@SuperQ would you mind taking a look when you get time? Lemme know your thoughts 👍 |
Ah, good point, I appreciate the forethought. I'll rework it to not coerce nils and leave them out 👍 |
Part of prometheus#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>
Fixes: ``` ts=2024-06-11T19:04:55.591Z caller=meminfo.go:44 level=debug collector=meminfo msg="Set node_mem" memInfo="unsupported value type" ``` Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
Nil entries in procfs.Meminfo fields indicate that the value isn't present on the system. Coercing those nil values to `0` introduces new metrics on systems that should not be present and can break some queries. Addresses PR feedback: prometheus#3049 (comment) prometheus#3049 (comment) Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
4ee485e
to
d088970
Compare
@SuperQ is this more in line with what you were thinking? |
Yes, this is looking much better. I'll try and do a deeper review soon. |
Friendly bump. @SuperQ please lemme know if you have any further thoughts 👍 |
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