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

Free space mismatch #8

Open
lazaroblanc opened this issue Jul 22, 2024 · 4 comments
Open

Free space mismatch #8

lazaroblanc opened this issue Jul 22, 2024 · 4 comments

Comments

@lazaroblanc
Copy link

The zfsprom_free metric is showing over 200 G free, while zfs list shows 67 G free.
Any idea how this happens?

image

image

@matusnovak
Copy link
Owner

Hi.

This is interesting. I can not reproduce it on my pool.

The calculation is implemented as:

# "stats" are from the libzfs library
metric_free = stats.size - stats.allocated

But I believe this is a wrong calculation.

Could you share the output of your zpool list command of pool1? And do you have any snapshots?

Also, FYI, I would recommend using zpool_influxdb instead. It has been integrated into the ZFS apt package. You can read InfluxDB formatted metrics (InfluxDB Telegraf can read them and convert to Prometheus formatted metrics).

@lazaroblanc
Copy link
Author

lazaroblanc commented Aug 29, 2024

Ah that's interesting. Here it shows 204 G "FREE" but before with zfs list it shows 67 G "AVAIL" image

AVAIL would be the correct metric since that's actually usable space. FREE shows the entirety of free space including reserved "slop space"

@lazaroblanc
Copy link
Author

Also, FYI, I would recommend using zpool_influxdb instead. It has been integrated into the ZFS apt package. You can read InfluxDB formatted metrics (InfluxDB Telegraf can read them and convert to Prometheus formatted metrics).

Thanks for the recommendation but I liked this script because of the simplicity of the setup. If I migrate I might just do it with a bash oneliner or script and the node_exporter text collecter since that's already running anyway :)

@matusnovak
Copy link
Owner

I believe I can add a metric for AVAIL.

However, due to truenas/py-libzfs#249 I am no longer able to build a new Docker image.

This issue is blocked until then :(

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

No branches or pull requests

2 participants