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

Add capacity, used and free space of ZFS pool on Linux #13014

Closed
PierreF opened this issue Apr 3, 2023 · 2 comments
Closed

Add capacity, used and free space of ZFS pool on Linux #13014

PierreF opened this issue Apr 3, 2023 · 2 comments
Labels
feature request Requests for new plugin and for new features to existing plugins

Comments

@PierreF
Copy link
Contributor

PierreF commented Apr 3, 2023

Use Case

I want to graph the percent of my ZFS disk space utilization (close to df Use% on classical filesystem).

Using value for standard df (or disk input) result in unexpected behavior, because the utilization percent will grow on ALL filesystems when data is written to a single one. So on a graph, you could see an increase in utilization of an filesystem even if nothing changed for this filesystem.

Actually with ZFS, only the ZFS pool capacity don't have this issue (that probably why zfs list don't have a capacity utilization in %).

Expected behavior

Have the same zfs_pool metrics that FreeBSD had:
zfs_pool

  • allocated (integer, bytes)
  • capacity (integer, bytes) <--- BTW this isn't bytes, but a %. It's the value I want
  • dedupratio (float, ratio)
  • free (integer, bytes)
  • size (integer, bytes)

Actual behavior

Those metrics aren't available on Linux, only on FreeBSD

Additional info

The metrics I want are available on FreeBSD, gathered using zpool command output.

This command seems to works exactly the same on Linux (at least Ubuntu 22.04) and works from user. Could we use the same gather that is used on FreeBSD ? Probably in addition to the one used with Linux which gather more metrics.

This should also bring the zpool health as tags like on FreeBSD (which should fix #10619).

The only issue I see with this approach is that tags for "zfs_pool" measurement which not be the same between Linux version and the FreeBSD version. And since on Linux (with ZFS >= 2.1.x) we have a per-dataset "zfs_pool" measurement, it will make merging both set of tags complicated.

I can help with a PR to also run zpool list (and zfs list ?) on Linux to gather those metrics like on FreeBSD, but we need to resolve under which name with which tags we should do that.

@PierreF PierreF added the feature request Requests for new plugin and for new features to existing plugins label Apr 3, 2023
@powersj
Copy link
Contributor

powersj commented Apr 3, 2023

Hi,

This sounded like a familiar request and I went back and found two PRs:

There were discussions about using the CLI commands, but it was generally not accepted due to changing formats, permissions, etc. It did sound like there was a zpool_influxdb command to get some data out in a stable manner.

Is that command available to you?

@powersj powersj added the waiting for response waiting for response from contributor label Apr 3, 2023
@PierreF
Copy link
Contributor Author

PierreF commented Apr 4, 2023

Hi,

thanks for your quick answer. I've missed the existing issues when searching for existing report. I should be able to use zpool_influxdb which looks a good fit. If not (due to possible cross-compile issue), I should be able to make a Go wrapper around zpool command in similar way to zpool_influxdb with exec plugin.

Closing the issue since my request have a valid answer for my use-case.

@PierreF PierreF closed this as completed Apr 4, 2023
@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

2 participants