Skip to content

Free space mismatch #8

@lazaroblanc

Description

@lazaroblanc

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

image

image

Activity

matusnovak

matusnovak commented on Aug 23, 2024

@matusnovak
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

lazaroblanc commented on Aug 29, 2024

@lazaroblanc
Author

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

lazaroblanc commented on Aug 29, 2024

@lazaroblanc
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

matusnovak commented on Nov 14, 2024

@matusnovak
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @matusnovak@lazaroblanc

        Issue actions

          Free space mismatch · Issue #8 · matusnovak/prometheus-zfs