-
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
Adding protocols collector #1921
Conversation
Even if the exporter is disabled by default a user might want to filter the protocols that they are exporting. For my particular use case I'm only interested in the stats that experience memory pressure, namely TCP. I imagined some users might want to track a subset of all protocols and figured some filtering mechanism would offer that flexibility. |
Yes, I agree |
Does it make sense to have it in https://github.com/prometheus/procfs proper first? |
Yes that makes sense. What's the best way to go about that? Since the commit was accepted I figured I would wait for it to get included in a release so I can update the procfs version in the modules files for the PR. I'm happy to go about it another way if it's less noisy or easier for anyone involved. |
Once it will be merged in procfs and release you will be able to update this PR. |
Sounds good, I'll keep an eye on the procfs release and update this PR accordingly. Thanks! |
Signed-off-by: Juan Bran <[email protected]>
Signed-off-by: Juan Bran <[email protected]>
Signed-off-by: Juan Bran <[email protected]>
Signed-off-by: Juan Bran <[email protected]>
@roidelapluie Sorry for the mess here, I'm not used to the fork and pull model and I should have merged instead of rebasing. I can recreate the PR if that helps. Also looks like an xfs bug fix in procfs v0.3.0 required updating the end-to-end tests, so I've updated that to fix CI. |
You could also force push, that would update this PR. |
Force push to which repo/branch? I rebased to master and then force-pushed to my fork's branch
|
The |
I have found the time to review this. I suggest tcpv6, tcp should go in labels and not be part of the metric names. We could also include "net" in the metric names.
|
fmt.Sprintf("%s_memory", p.Name), | ||
), | ||
fmt.Sprintf("Total number of 4KB pages allocated by %s", p.Name), |
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 should be converted to bytes.
@@ -0,0 +1,165 @@ | |||
// Copyright 2015 The Prometheus Authors |
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.
// Copyright 2015 The Prometheus Authors | |
// Copyright 2021 The Prometheus Authors |
subsystem, | ||
fmt.Sprintf("%s_pressure", p.Name), | ||
), | ||
fmt.Sprintf("Indicates whether %s is experiencing memory pressure; 1 = true, 0 = false, -1 = not implemented", p.Name), |
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 should be split into two metrics.
node_net_prototocols_implemented{protocol="TCPv6"} 1
node_net_prototocols_pressure{protocol="TCPv6"} 0
It looks like this is an issue in the procfs implementation. This should be fixed to return the proper state options as an iota
.
@juancb Do you still want to finish this or should we close it? |
Bump this. |
This patch adds a
/proc/net/protocols
collector. By default it only exports protocols matching the^tcp.*
regex in order to limit cardinality. This results in 12 additional metrics and are diagnostically useful in cases where the system is experiencing memory pressure. After looking through the repo and previous PRs it appeared to me that it was preferred to have the procfs parsing done in the procfs module. I have made the necessary commit there and this PR depends on prometheus/procfs#347Signed-off-by: Juan Bran [email protected]