Merged
Conversation
This code (both implementation and tests) is largely based on the existing mountinfo implementation. Signed-off-by: Steven McDonald <steven.mcdonald@usabilla.com>
mdlayher
reviewed
Dec 12, 2019
Contributor
mdlayher
left a comment
There was a problem hiding this comment.
From a code perspective this seems pretty good.
I'd like to see the tests make use of subtests and go-cmp, and I'd also like to see some tests with a fixture copied from /proc/swaps on your own system.
You can see what I did for tests in https://github.com/prometheus/procfs/blob/master/net_sockstat_test.go.
You can add fixtures by following https://github.com/prometheus/procfs#updating-test-fixtures.
b705b63 to
ec928a2
Compare
Contributor
Author
|
@mdlayher Does this look reasonable to you? |
Signed-off-by: Steven McDonald <steven.mcdonald@usabilla.com>
ec928a2 to
4e7c2da
Compare
discordianfish
approved these changes
Jan 9, 2020
fabiand
added a commit
to fabiand/node_exporter
that referenced
this pull request
Sep 24, 2025
Building on prometheus/procfs#246 this PR is introducing metrics around swap devices. Today metrics around swap are already available, but they are on the node level. With this PR, metrics are now available per device. Relates to: prometheus#1890 Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
fabiand
added a commit
to fabiand/node_exporter
that referenced
this pull request
Sep 24, 2025
Building on prometheus/procfs#246 this PR is introducing metrics around swap devices. Today metrics around swap are already available, but they are on the node level. With this PR, metrics are now available per device. Relates to: prometheus#1890 Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org> Co-authored-by: claude.ai
SuperQ
pushed a commit
to prometheus/node_exporter
that referenced
this pull request
Oct 6, 2025
* Add /proc/swaps collector Building on prometheus/procfs#246 this PR is introducing metrics around swap devices. Today metrics around swap are already available, but they are on the node level. With this PR, metrics are now available per device. Relates to: #1890 Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org> Co-authored-by: claude.ai --------- Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This code (both implementation and tests) is largely based on the existing mountinfo implementation.
Implementation of #244.