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

Sysfs collector #2008

Closed
wants to merge 2 commits into from
Closed

Sysfs collector #2008

wants to merge 2 commits into from

Conversation

dukelion
Copy link

@dukelion dukelion commented Mar 19, 2021

This allows us to read fs label and uuid and put them in prometheus metric labels to correlate block device with filesystem

An example of metrics:

# HELP node_disk_written_bytes_total Total number of bytes written successfully.
# TYPE node_disk_written_bytes_total counter
node_disk_written_bytes_total{device="nvme0n1"} 1.3957977472e+12
node_disk_written_bytes_total{device="sda"} 0
node_disk_written_bytes_total{device="dm-0",label="nvme0n1p3_crypt",uuid="CRYPT-LUKS1-59b07f005d1845c0b89ea668109c8620-nvme0n1p3_crypt"} 1.394846882816e+12
node_disk_written_bytes_total{device="dm-1",label="vg0-root",uuid="LVM-zfR6VpZ7Aw4oOxOFVzKjr3U4IbdAcHdzHr9xMGykOaaUGIYvHXbOZ90TiOh39RYr"} 1.50451893248e+11
node_disk_written_bytes_total{device="dm-2",label="vg0-swap",uuid="LVM-zfR6VpZ7Aw4oOxOFVzKjr3U4IbdAcHdz57dfmLeUwNAwux1IeLqgsZvf6X50xRNf"} 2.0113764352e+10
node_disk_written_bytes_total{device="dm-3",label="vg0-docker",uuid="LVM-zfR6VpZ7Aw4oOxOFVzKjr3U4IbdAcHdzBIX4JweGDkNjwGcTQz6Mdc9I34lcPMXy"} 1.6261039104e+10
node_disk_written_bytes_total{device="dm-4",label="vg0-home",uuid="LVM-zfR6VpZ7Aw4oOxOFVzKjr3U4IbdAcHdztuw9L0gMfhuUcaTIpVx9mJDYeSE7QtWb"} 1.226629317632e+12

Also solves #885 and #1601

Signed-off-by: Vasilii Alferov <vasilii@cloudflare.com>
Signed-off-by: Vasilii Alferov <vasilii@cloudflare.com>
@SuperQ
Copy link
Member

SuperQ commented Mar 19, 2021

sysfs parsing needs to be implemented in prometheus/procfs first.

@dukelion
Copy link
Author

sysfs parsing needs to be implemented in prometheus/procfs first.

Sure can do!
btw, diskstats_linux also reads from procfs without prometheus/procfs

@SuperQ
Copy link
Member

SuperQ commented Mar 19, 2021

Yes, that code is very old and needs to be fixed.

One thing to note, we don't want to put all of the labels on all metrics. The plan is to introduce a new node_disk_info metric to allow mapping of udev data. Lables on devices need to stay consistent, and not all devices have the dm data needed for this.

There was a discussion about this in #304, but we have not re-opened the feature proposal discussed there.

Part of the reason we are still using the old /proc interface is we have traditionally supported kernels all the way back to 2.6.32. These kernels did not support the /sys/class/block interface. The hard part of this is RHEL 6 is still out there, with extended support. And RHEL 7 is still only 3.10 kernel.

@luizluca
Copy link
Contributor

I just noticed this PR. I created a #2042 modifying the existing collector.

@discordianfish
Copy link
Member

To track monitoring by uuid I've created #2207
Ideally implementing that is done while refactoring diskstats to use procfs. I think this PR here though can be closed for now.

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.

None yet

4 participants