Skip to content

filesystem collector: use correct block size unit on NetBSD - #3800

Open
recursivetree wants to merge 1 commit into
prometheus:masterfrom
recursivetree:master
Open

filesystem collector: use correct block size unit on NetBSD#3800
recursivetree wants to merge 1 commit into
prometheus:masterfrom
recursivetree:master

Conversation

@recursivetree

Copy link
Copy Markdown

I've noticed that the filesystem exporter is reporting wrong values for node_filesystem_avail_bytes , node_filesystem_free_bytes, and node_filesystem_size_bytes. These values come from a SYS_GETVFSSTAT syscall and are originally in blocks, not bytes. To convert them to blocks, the filesystem collector uses the wrong factor (f_bsize inseat of f_frsize). See https://nxr.netbsd.org/xref/src/sys/sys/statvfs.h#72

This PR fixes the converter so it export the correct values. However, this will cause a discontinuity in the data for existing installs. I don't know how this is usually handled/if this is acceptable.

Unrelated: While testing this PR I ran into some compile errors in filesystem_netbsd.go around debug logging. I've just commented them out to test this.

F_blocks, F_bfree and F_bavail is in units of f_frsize. See https://nxr.netbsd.org/xref/src/sys/sys/statvfs.h#72

Signed-off-by: Yuri Honegger <yurix@netbsd.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant