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

Expose zfs zpool state #1878

Merged
merged 1 commit into from
Dec 13, 2020
Merged

Expose zfs zpool state #1878

merged 1 commit into from
Dec 13, 2020

Conversation

Hexta
Copy link

@Hexta Hexta commented Oct 27, 2020

Create a metric node_zfs_zpool_state with the state of ZFS pools.

I've implemented parsing /proc/spl/kstat/zfs//state files.
Metrics format is similar to node_systemd_unit_state:

node_zfs_zpool_state{state="degraded",zpool="lxd"} 0
node_zfs_zpool_state{state="faulted",zpool="lxd"} 0
node_zfs_zpool_state{state="offline",zpool="lxd"} 0
node_zfs_zpool_state{state="online",zpool="lxd"} 1

Suggestions are welcome.
I'm a little confused by the help string of the new metric.

@Hexta Hexta force-pushed the zfs_zpool_state branch 2 times, most recently from a7ca04c to 2035d0f Compare October 27, 2020 14:35
Create a metric node_zfs_zpool_state.

Signed-off-by: Artur Molchanov <artur.molchanov@easybrain.com>
@Hexta
Copy link
Author

Hexta commented Oct 28, 2020

@SuperQ Could you please take a look at the PR?

@SuperQ
Copy link
Member

SuperQ commented Oct 28, 2020

One of these days we should move the ZFS parsing to https://github.com/prometheus/procfs.

@Hexta
Copy link
Author

Hexta commented Oct 28, 2020

@SuperQ So I should to wait until move complete? And then create a PR to https://github.com/prometheus/procfs?

@SuperQ
Copy link
Member

SuperQ commented Oct 28, 2020

If you're interested in working on the procfs code, I would really appreciate it. But I'm not going to block this feature on it.

@Hexta
Copy link
Author

Hexta commented Oct 28, 2020

@SuperQ I'm ready to implement this feature in procfs but we need it in our production as soon as possible.
Is it possible to merge this PR and then continue to work on procfs?

@SuperQ
Copy link
Member

SuperQ commented Oct 28, 2020

Yea, that's fine. I'll review this as soon as I can.

@Hexta
Copy link
Author

Hexta commented Nov 17, 2020

@SuperQ Is there any chance to merge this PR?

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hexta
Copy link
Author

Hexta commented Nov 30, 2020

@SuperQ Hello. Could you please review the PR?

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ SuperQ merged commit 82e8db0 into prometheus:master Dec 13, 2020
@SuperQ SuperQ mentioned this pull request Feb 5, 2021
SuperQ added a commit that referenced this pull request Feb 5, 2021
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

Changes:
* [CHANGE] Improve filter flag names. #1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default #1897
* [FEATURE] Add fibre channel collector #1786
* [FEATURE] Expose cpu bugs and flags as info metrics. #1788
* [FEATURE] Add network_route collector #1811
* [FEATURE] Add zoneinfo collector #1922
* [ENHANCEMENT] Add more InfiniBand counters #1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics #1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector #1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics #1733
* [ENHANCEMENT] Add pool size to entropy collector #1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 #1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats #1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric #1810
* [ENHANCEMENT] Expose XFS inode statistics #1870
* [ENHANCEMENT] Expose zfs zpool state #1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable #1947
* [BUGFIX] filesystem_freebsd: Fix label values #1728
* [BUGFIX] Fix various procfs parsing errors #1735
* [BUGFIX] Handle no data from powersupplyclass #1747
* [BUGFIX] udp_queues_linux.go: s/upd/udp/ in two error strings #1769
* [BUGFIX] Fix node_scrape_collector_success behaviour #1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions #1827
* [BUGFIX] fix: node_md_disks state label from fail to failed #1862
* [BUGFIX] Handle EPERM for syscall in timex collector #1938
* [BUGFIX] bcache: fix typo #1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@gmail.com>
SuperQ added a commit that referenced this pull request Feb 5, 2021
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

NOTE: We have improved some of the flag naming conventions (PR #1743). The old names are
      deprecated and will be removed in 2.0. They will continue to work for backwards
      compatibility.

* [CHANGE] Improve filter flag names #1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default #1897
* [FEATURE] Add fibre channel collector #1786
* [FEATURE] Expose cpu bugs and flags as info metrics. #1788
* [FEATURE] Add network_route collector #1811
* [FEATURE] Add zoneinfo collector #1922
* [ENHANCEMENT] Add more InfiniBand counters #1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics #1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector #1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics #1733
* [ENHANCEMENT] Add pool size to entropy collector #1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 #1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats #1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric #1810
* [ENHANCEMENT] Expose XFS inode statistics #1870
* [ENHANCEMENT] Expose zfs zpool state #1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable #1947
* [BUGFIX] filesystem_freebsd: Fix label values #1728
* [BUGFIX] Fix various procfs parsing errors #1735
* [BUGFIX] Handle no data from powersupplyclass #1747
* [BUGFIX] udp_queues_linux.go: change upd to udp in two error strings #1769
* [BUGFIX] Fix node_scrape_collector_success behaviour #1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions #1827
* [BUGFIX] Fix node_md_disks state label from fail to failed #1862
* [BUGFIX] Handle EPERM for syscall in timex collector #1938
* [BUGFIX] bcache: fix typo in a metric name #1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@gmail.com>
@onedr0p
Copy link

onedr0p commented Aug 5, 2022

This metric appears to not be showing up

#2442

oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

NOTE: We have improved some of the flag naming conventions (PR prometheus#1743). The old names are
      deprecated and will be removed in 2.0. They will continue to work for backwards
      compatibility.

* [CHANGE] Improve filter flag names prometheus#1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default prometheus#1897
* [FEATURE] Add fibre channel collector prometheus#1786
* [FEATURE] Expose cpu bugs and flags as info metrics. prometheus#1788
* [FEATURE] Add network_route collector prometheus#1811
* [FEATURE] Add zoneinfo collector prometheus#1922
* [ENHANCEMENT] Add more InfiniBand counters prometheus#1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics prometheus#1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector prometheus#1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics prometheus#1733
* [ENHANCEMENT] Add pool size to entropy collector prometheus#1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 prometheus#1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats prometheus#1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric prometheus#1810
* [ENHANCEMENT] Expose XFS inode statistics prometheus#1870
* [ENHANCEMENT] Expose zfs zpool state prometheus#1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable prometheus#1947
* [BUGFIX] filesystem_freebsd: Fix label values prometheus#1728
* [BUGFIX] Fix various procfs parsing errors prometheus#1735
* [BUGFIX] Handle no data from powersupplyclass prometheus#1747
* [BUGFIX] udp_queues_linux.go: change upd to udp in two error strings prometheus#1769
* [BUGFIX] Fix node_scrape_collector_success behaviour prometheus#1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions prometheus#1827
* [BUGFIX] Fix node_md_disks state label from fail to failed prometheus#1862
* [BUGFIX] Handle EPERM for syscall in timex collector prometheus#1938
* [BUGFIX] bcache: fix typo in a metric name prometheus#1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

NOTE: We have improved some of the flag naming conventions (PR prometheus#1743). The old names are
      deprecated and will be removed in 2.0. They will continue to work for backwards
      compatibility.

* [CHANGE] Improve filter flag names prometheus#1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default prometheus#1897
* [FEATURE] Add fibre channel collector prometheus#1786
* [FEATURE] Expose cpu bugs and flags as info metrics. prometheus#1788
* [FEATURE] Add network_route collector prometheus#1811
* [FEATURE] Add zoneinfo collector prometheus#1922
* [ENHANCEMENT] Add more InfiniBand counters prometheus#1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics prometheus#1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector prometheus#1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics prometheus#1733
* [ENHANCEMENT] Add pool size to entropy collector prometheus#1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 prometheus#1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats prometheus#1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric prometheus#1810
* [ENHANCEMENT] Expose XFS inode statistics prometheus#1870
* [ENHANCEMENT] Expose zfs zpool state prometheus#1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable prometheus#1947
* [BUGFIX] filesystem_freebsd: Fix label values prometheus#1728
* [BUGFIX] Fix various procfs parsing errors prometheus#1735
* [BUGFIX] Handle no data from powersupplyclass prometheus#1747
* [BUGFIX] udp_queues_linux.go: change upd to udp in two error strings prometheus#1769
* [BUGFIX] Fix node_scrape_collector_success behaviour prometheus#1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions prometheus#1827
* [BUGFIX] Fix node_md_disks state label from fail to failed prometheus#1862
* [BUGFIX] Handle EPERM for syscall in timex collector prometheus#1938
* [BUGFIX] bcache: fix typo in a metric name prometheus#1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@gmail.com>
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

Successfully merging this pull request may close these issues.

4 participants