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

HostDiskSpace alert doesn't trigger with mountpoints below / #331

Open
guimaluf opened this issue Nov 18, 2024 · 1 comment
Open

HostDiskSpace alert doesn't trigger with mountpoints below / #331

guimaluf opened this issue Nov 18, 2024 · 1 comment

Comments

@guimaluf
Copy link

Bug Description

If we have a mountpoint for anything under / the alert doesn't trigger when the disk usage of this mountpoint is above the threshold.

That seems to be due the HostDiskSpace metric uses a regex matching plain / and not everything within it:
used_disk_space{mountpoint=~"/"} > 90

A lazy approach would be changing to mountpoint=~"/.*". That way, everything below / would match the alert.

To Reproduce

On any monitored system

# create a dummy file
fallocate -l10G /var/tmp/host_disk_space
# get a free loop device
losetup -f 
# use the free loop device
losetup /dev/loop9 /var/tmp/host_disk_space
# create the file system
mkfs -t ext4 /dev/loop9
# mount
mount /dev/loop9 /mnt/
# fill up the mountpoint
fallocate -l9G /mnt/fillup

No alerts are generated that way.

Environment

n/a

Relevant log output

n/a

Additional context

No response

@sed-i
Copy link
Contributor

sed-i commented Dec 13, 2024

Thanks @guimaluf!
We should also fix this in the VM charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants