Skip to content
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

metrics: collect disk usage from internal metrics #21062

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomasmatus
Copy link
Member

use mount.total and mount.used from internal metrics instead of parsing df output.

@jelly
Copy link
Member

jelly commented Oct 1, 2024

Fun times, you forget one important detail, the JS code filters mount points (loopback, flatpak, and? tmpfs?)

use `mount.total` and `mount.used` from internal metrics
instead of parsing `df` output.
@tomasmatus tomasmatus force-pushed the port-mountpoints-internal-metrics branch from ad6a56d to e692d9d Compare October 3, 2024 12:44
path = line.split()[1]
split_line = line.split()
# Skip read-only loop mounts
if '/loop' in split_line[0] and 'ro' in split_line[3].split(','):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be nicer to properly decompose this

mounts = open('/proc/mounts').read()
fs_spec, fs_file, fs_vfstype, fs_mntopts, *_rest  = mounts.splitlines()[0].split()

Not sure if one can remove *_rest, field definitions comes from https://man.archlinux.org/man/fstab.5

continue
# Hide flatpaks
if 'revokefs-fuse' in split_line[0] and 'flatpak' in split_line[1]:
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

tmpfs /run/credentials/systemd-journald.service tmpfs ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k

Mount point exists, but we likely don't want it.

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.

2 participants