Commit graph

22 commits

Author SHA1 Message Date
Daniel Swarbrick ebf3cbfbb3 zfs: drop superfluous typecasting of test values
Drop superfluous and overly pedantic typecasting for values that fit
within 32 bits or where type comparison is already hinted.

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2024-09-30 14:52:38 +02:00
Pranshu Srivastava ff20a6ac48
collector/zfs: Prevent procfs integer underflow (#2961)
* collector/zfs: Prevent `procfs` integer underflow

Prevent integer underflow when parsing the `procfs` file as it used a
`ParseUint` to parse signed values.

Fixes: #2766
---------

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-07-14 14:36:30 +02:00
Caleb Webber 6d18ce7bca
Revert "Add ZFS freebsd per dataset stats (#2753)" (#2925)
This reverts commit f34aaa6109.

Signed-off-by: Caleb Webber <caleb@codingthemsoftly.com>
2024-02-14 09:13:18 +01:00
Conall O'Brien f34aaa6109
Add ZFS freebsd per dataset stats (#2753)
* Rename parsePoolObjsetFile to parseLinuxPoolObjsetFile to better reflect
it's scope
* Create a new parseFreeBSDPoolObjsetStats function, to generate a list
of per pool metrics to be queried via sysctl


---------

Signed-off-by: Conall O'Brien <conall@conall.net>
2023-09-11 06:33:21 +02:00
dongjiang 1bbb2a94c0
fix(zfs): add memory_available_bytes, fix dbufstats filename on Linux (#2687)
* Fix zfs memory_available_bytes collector
* Fix zfs dbufstats collector
---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2023-05-23 11:13:48 +02:00
Pablo Caderno d31af1d1e5
feat: added suspended as a node_zfs_zpool_state (#2449)
Signed-off-by: Pablo Caderno <kaderno@gmail.com>
2023-04-26 18:12:54 +02:00
Benjamin Drung 0dc82eac13
Correctly disable ZFS for test cases (#2182)
Disable `collector/zfs_linux_test.go` in case `!nozfs` is set to
completely disable ZFS.

Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-10-28 15:27:15 +02:00
Artur Molchanov 519203e3d0 Expose zfs zpool state
Create a metric node_zfs_zpool_state.

Signed-off-by: Artur Molchanov <artur.molchanov@easybrain.com>
2020-10-27 17:39:13 +03:00
Sudhar287 6807e5319b
read contents of objset file (#1632)
* added objread functionality

Signed-off-by: Sudharshann D <sudhar287@gmail.com>
2020-05-13 21:06:00 +02:00
Richard Elling d7348a5c78 updates for zfsonlinux 0.7.5 (#779)
* updates for zfsonlinux 0.7.5

* add constants for KSTAT_DATA_* types

* added e2e test for negative values represented by uint64 that can result from ZFS bugs
2018-02-16 15:46:31 +01:00
Franz Pletz d432f9857e Use uint64 in the ZFS collector (#714)
ZFS metrics can also be unsigned 64-bit integers that won't fit in
int64 and causes the whole collector to fail.
2018-01-06 12:36:55 +01:00
Matthias Rampke e1f129c729 Use int64 throughout the ZFS collector.
This avoids issues with integer overflows on 32-bit architectures. The
Prometheus data format is float64, so regardless of the architecture we
should handle large numbers.

Fixes #629.
2017-08-21 16:40:16 +00:00
Joe Handzik bb8b3fca88 ZFS Collector: Add zpool IO statistics
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-02-10 13:31:25 -06:00
Joe Handzik e213ccbc57 ZFS Collector: Refactor to use maps/slices and fewer globals
Removed all global types that were unnecessary, and refactored to use constructor-created values and inline values instead of globals.

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-27 14:02:28 -06:00
Joe Handzik 94fb93a9f3 ZFS Collector: Add dmu_tx functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:41:15 -06:00
Joe Handzik 07c7ae733a ZFS Collector: Add fm functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:31:22 -06:00
Joe Handzik 05048c067d ZFS Collector: Add xuio_stats functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:30:37 -06:00
Joe Handzik 3c9e779989 ZFS Collector: Add vdev_cache_stats functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:29:50 -06:00
Joe Handzik a02ca9502c ZFS Collector: Add zil functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:29:00 -06:00
Joe Handzik a3125ab4d9 ZFS Collector: Add zfetchstats functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:28:11 -06:00
Corey Stewart a8c94d48e6 Style changes and cleanup
This patch makes stylistic changes to error strings, unexports method names by lower casing them, removes unused dataSetMetric, and adds copyright/licence information.

Signed-Off-By: Corey Stewart <stewa169@purdue.edu>
2017-01-08 10:23:58 -06:00
Christian Schwarz f29f3873ea Add a collector for ZFS, currently focussed on ARC stats.
It is tested on FreeBSD 10.2-RELEASE and Linux (ZFS on Linux 0.6.5.4).

On FreeBSD, Solaris, etc. ZFS metrics are exposed through sysctls.
ZFS on Linux exposes the same metrics through procfs `/proc/spl/...`.

In addition to sysctl metrics, 'computed metrics' are exposed by
the collector, which are based on several sysctl values.
There is some conditional logic involved in computing these metrics
which cannot be easily mapped to PromQL.

Not all 92 ARC sysctls are exposed right now but this can be changed
with one additional LOC each.
2017-01-08 10:23:58 -06:00