-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add mountpoint label and port label to mounstats collector (#993) #994
Conversation
The fixture |
collector/mountstats_linux.go
Outdated
@@ -111,8 +138,8 @@ func NewMountStatsCollector() (Collector, error) { | |||
) | |||
|
|||
var ( | |||
labels = []string{"export"} | |||
opLabels = []string{"export", "operation"} | |||
labels = []string{"export", "mountpoint", "xprt"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this doc, the first column of the xprt
line is srcport
, so the label should be srcport
not xprt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I will update this to srcport
. I will also update collector/fixtures/e2e-64k-page-output.txt
.
I'm still thinking we should de-dupe on mountpoint, but if there are mounts with different version, we should include that as a label. I'm also thinking the source port label isn't very useful, really what we probably want in order to correctly expose data is |
NFS has the option to let clients communicate using non-privileged ports. This makes it possible for the nfs client to communicate with the same export using a privileged and a non-privileged port. |
Don't feel strongly about the source port but in general LGTM! 👍 |
Could you tell me why buildkite is breaking? Thank you |
@@ -2198,7 +2267,7 @@ node_sockstat_TCP_inuse 4 | |||
node_sockstat_TCP_mem 1 | |||
# HELP node_sockstat_TCP_mem_bytes Number of TCP sockets in state mem_bytes. | |||
# TYPE node_sockstat_TCP_mem_bytes gauge | |||
node_sockstat_TCP_mem_bytes 65536 | |||
node_sockstat_TCP_mem_bytes 4096 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks unrelated to this PR.
… and port Add updated e2e tests Change xprt to srcport Change e2e-output.txt to support new label srcport Change e2e-64k-page-output.txt to support srcport label Change TCP_mem_bytes back to 65536 from 4096 Signed-off-by: Arsen Akishev <[email protected]>
So, to sum my thoughts on the discussion spread over #993, #996 and this merge request: We have a few different properties for every NFS mount:
I think it makes sense to deduplicate NFS mounts by grouping by the tuple This means that when you e.g. mount the same export with the same protocol but different NFS versions on the same mountpoint, you will get two sets of metrics. I think that this makes sense. Otherwise, you would lose existing metrics when mounting over an existing mount. I would definitely not use I think having a For #996, I already updated the duplicate detection logic. Maybe I can open another merge request so we can compare the approaches and arrive at a good solution? About the NFS version label in prometheus/procfs: It looks a bit more involved to do. The EDIT I tested it locally: Mounting the same export on two different mountpoints using the same parameters (protocol, version) yields the exact same metrics in |
@hakoerber I think taking mountpoint out of the tuple makes sense. But srcport may be necessary. And yes we should find a way to add a parser for the opts line in procfs. In my case I am using Dell EMC Isilon, to pool the ip addresses to the same domain name. This creates a situation where NFS lets me mount with the same export and mountpoint multiple times without any issues; this happens because the domain name resolves to a different ip. Every mount gets recorded separately in /proc/self/mountstats
It may be possible that other users will have an equivalent setup whether its through Isilon or not, where NFS will let them mount exports to the same mountpoint because the domain name will resolve differently. I can't think of a better way to dedup for this issue. Suggestions would be welcome. |
Wow, did not know that this was possible. The The problem I see with This means that when I reboot a server, afterwards, the time series will be different because the Is there anything else that differs between those two mounts that is static and can be used to tell them apart and used as a label? |
The mounts can act as backups or just alternatives for access. As for the issue with I do not think there is anything within I would still like to have a protocol and nfs version exported as a label. I can raise an issue in github.com/prometheus/procfs for the nfs versioning and start working on a parser for the |
@hakoerber @arsenakishev How do you want to split the work? Let's either finish one by one, starting with the earliest (this) or moving the changes from #998 here. Up to you! |
Now that the port issue came up I am not sure how to proceed. I wouldn’t
want to introduce any bugs. Any suggestions?
I think the /proc/self/mountstats keep the most active mount at the bottom of the list. My new approach would be to use the lowest mount in the list to actually report the metrics and to report any duplicates with a duplicate label.
Another option is to dedup by the port and the mountpoint, which is the state that I changed the code into. If somebody remounts and changes the port then it will cause a duplicate in the tsdb.
|
Now with #998 merged, are there still changes from this PR required or can we close it? |
It's fine to close this. If I come up with a better solution I can open another PR. |
Okay great, thanks everybody involved! |
I don't believe there is any way to deterministically distinguish between duplicate mounts in a way that won't create new time series, but this is still an issue that I think deserves some attention. The source port will change each time you remount, which leaves undesirable effects for a lot of people. However, I think that the mountaddr would isolate this effect to those that are using pooled ip addresses. Anyone that isn't would still see the same ip address each time instead of getting a new port on each restart. Mount address isn't currently exposed from procfs (unless I'm mistaken) but it doesn't seem like a big change to expose it. Given a pool of ip addresses you will get new time series on restarts, but personally I think that seeing the duplicate mounts is more beneficial than having new time series. In general, I don't see many situations that anyone would be filtering by the ip address instead of the mount point or export, especially when they know they have a pool of ip addresses. Does anyone have any opinions on reviving this with source port changed to mount address? |
@discordianfish @SuperQ @hakoerber Any opinions on the above? |
I need to look over this some more, but I don't have any time in the next week. What about just including the extra mount information as a separate label. It may generate new series, but this can be aggregated away at query time. |
All good, my idea was basically to just include a mount address label onto the mountstats metrics. Possibly also adding mount point but I don't really think that you should need the mount point. |
@SuperQ I know the holidays are probably keeping everyone busy, just curious if you had a chance to look at this. |
I think that's fine. The address dimension should be fairly bounded. |
@discordianfish I've been working on distinguishing between multiple machines mounted to the same mountpoint, and my method involves depending on the During testing, I've discovered that the |
After some research, I've found that the information I require is present in Can I modify the |
It would be good to add the Can you open a new issue there with the details: |
This method takes the original way of removing duplicates from the mountstat collector and replaces it with consideration for mountpoint and port number.
Signed-off-by: Arsen Akishev [email protected]