-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Export gauge of last ZFS snapshot timestamp #1776
Comments
Do you know where in the ZFS procfiles this can be found? |
No, I'm not certain. |
It looks like it might be read out of /dev/zfs with some internal API. I use the following command to get the timestamp of the last snapshot:
I think you can also get this info by linking to libzfs. |
Unfortunately, there are two problems with that method.
|
Fair.
...sorry, what? Another option would be executing the zfs command I mentioned above and parsing the output. The format is stable. |
We also do not allow executing sub processes. |
Okay, but the CGO limitation doesn't make any sense to me. Linking to CGO is something which is well-understood and well-supported on all Linux distros. |
While it seems that way, it's not as great as it seems. There have been numerous bugs caused by CGO in the past. We try to avoid it as much as possible. |
The only one I can think of is issues with musl. The main musl distribution is Alpine Linux, and this is resolved by using an Alpine Linux package to install node_exporter. The maintainer of that package is yours truly. |
There have been several others, this one was great. We don't want CGO and all that comes with it. |
Here is a script to get ZFS snapshot metrics with the textfile collector: prometheus-community/node-exporter-textfile-collector-scripts#136 |
Yeah I think a separate exporter or textfile collector script would be most appropriate, so closing this for now. |
I like to set an alarm on the age of my backups to make sure that they're being taken, and I would similarly like to set an alarm on snapshot age.
The text was updated successfully, but these errors were encountered: