You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I would like to ask a question. When using node-exporter for metric collection, I have noticed an inconsistency in the behavior of the metric "node_filesystem_readonly" across different versions. In version 1.6.1, the value is obtained through /proc/1/mounts' options, while in the latest version, it is obtained through /proc/1/mountinfo. When I execute the following commands on the host with a read-only root partition:
As per the code logic, in version 1.6.1, the "ro" value is 1, whereas in the latest version, it is 0 (the options value in the new version's file does not include "ro", but the super options include it). I would like to confirm whether this metric's meaning does not include cases where super options are set to "ro".
In filesystem_linux.go, you can see that it parses the mount options from the sixth field group, i.e. rw,relatime in your case. It ignores the super-options completely.
Excerpt from mount(2) manpage:
Since Linux 2.6.16, MS_RDONLY can be set or cleared on a per-
mount-point basis as well as on the underlying filesystem
superblock. The mounted filesystem will be writable only if
neither the filesystem nor the mountpoint are flagged as read-
only.
So for the node_filesystem_readonly metric to have any real meaning, it would need to take both the per-mount options and per-superblock options into account.
Question description
Hello, I would like to ask a question. When using node-exporter for metric collection, I have noticed an inconsistency in the behavior of the metric "node_filesystem_readonly" across different versions. In version 1.6.1, the value is obtained through /proc/1/mounts' options, while in the latest version, it is obtained through /proc/1/mountinfo. When I execute the following commands on the host with a read-only root partition:
As per the code logic, in version 1.6.1, the "ro" value is 1, whereas in the latest version, it is 0 (the options value in the new version's file does not include "ro", but the super options include it). I would like to confirm whether this metric's meaning does not include cases where super options are set to "ro".
The PR that caused this question: b9d0932
Host operating system: output of
uname -a
Linux host 4.19.90-2307.3.0.el7.v60.x86_64 #1 SMP Mon Aug 26 14:27:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
node_exporter version: output of
node_exporter --version
node_exporter, version 1.6.1 (branch: HEAD, revision: 4a1b776)
build user: root@586879db11e5
build date: 20230717-12:10:52
go version: go1.20.6
platform: linux/amd64
tags: netgo osusergo static_build
node_exporter command line flags
node_exporter log output
Are you running node_exporter in Docker?
no
What did you do that produced an error?
Make the root partition read-only
What did you expect to see?
The node_filesystem_readonly{mountpoint="/"} is set to 1 when the root partition is read-only.
What did you see instead?
The node_filesystem_readonly{mountpoint="/"} is set to 0 when the root partition is read-only.
The text was updated successfully, but these errors were encountered: