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

Request for Btrfs device stats collection #2173

Closed
kennethjor opened this issue Oct 21, 2021 · 6 comments
Closed

Request for Btrfs device stats collection #2173

kennethjor opened this issue Oct 21, 2021 · 6 comments

Comments

@kennethjor
Copy link

I don't see stats from the btrfs device stats command in my metrics. I see a closed ticket #1100 already exists for this, but can't immediately find anything about this in the code either. So I'm wondering if it was ever implemented?

Host operating system:

Linux klaatu 5.8.0-63-generic #71-Ubuntu SMP Tue Jul 13 15:59:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version:

node_exporter, version 1.2.2 (branch: HEAD, revision: 26645363b486e12be40af7ce4fc91e731a33104e)
  build user:       root@b9cb4aa2eb17
  build date:       20210806-13:44:18
  go version:       go1.16.7
  platform:         linux/amd64

node_exporter command line flags

/usr/local/bin/node_exporter --collector.systemd --collector.textfile --collector.textfile.directory=/var/lib/node_exporter --web.listen-address=0.0.0.0:9102 --web.telemetry-path=/metrics

Are you running node_exporter in Docker?

Not Docker, deployed with Ansible.

@kennethjor kennethjor changed the title Btrfs device stats collection Request for Btrfs device stats collection Oct 21, 2021
@discordianfish
Copy link
Member

@kennethjor
Copy link
Author

@discordianfish Has it not just been released then, or are the metrics renamed somewhere? The output of the command is something like

[/dev/sda].write_io_errs    0
[/dev/sda].read_io_errs     0
[/dev/sda].flush_io_errs    0
[/dev/sda].corruption_errs  0
[/dev/sda].generation_errs  0
[/dev/sdb].write_io_errs    0
[/dev/sdb].read_io_errs     0
[/dev/sdb].flush_io_errs    0
[/dev/sdb].corruption_errs  0
[/dev/sdb].generation_errs  0
[/dev/sdc].write_io_errs    0
[/dev/sdc].read_io_errs     0
[/dev/sdc].flush_io_errs    0
[/dev/sdc].corruption_errs  0
[/dev/sdc].generation_errs  0
[/dev/sdd].write_io_errs    186
[/dev/sdd].read_io_errs     91
[/dev/sdd].flush_io_errs    0
[/dev/sdd].corruption_errs  4
[/dev/sdd].generation_errs  0

@kennethjor
Copy link
Author

For anyone else interested in this, there's a textile collector script that does this at https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/blob/master/btrfs_stats.py

@hhoffstaette
Copy link
Contributor

hhoffstaette commented Nov 3, 2021

The existing collector in node_exporter (as mentioned) does not export device stats/errors, due to the requirement of using ioctls and requring root. The script in the -community repo was a quick hack, which kind of works but has several problems. A much better collector for the device stats is here. Note that as of linux-5.14 btrfs will export the device stats to sysfs (commit) so the existing Go-based collector in node_exporter can and should be extended (probably via node_exporter/procfs).

@leth
Copy link
Contributor

leth commented Oct 7, 2022

I'm happy to report that this was added in #2193 and was released in 1.4.0 / 2022-09-24 😄
Please let me know if you find any issues!

@discordianfish
Copy link
Member

Great, I think we can close this then and re-open if something is missing!

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

No branches or pull requests

4 participants