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

Add UDP Metrics from /proc/net/snmp for Enhanced Network Analysis #3657

Open
Andrewmatilde opened this issue Feb 17, 2025 · 0 comments
Open

Comments

@Andrewmatilde
Copy link

Currently, cAdvisor retrieves UDP metrics by parsing /proc/net/udp and /proc/net/udp6, as shown below:

if h.includedMetrics.Has(container.NetworkUdpUsageMetrics) {
    u, err := udpStatsFromProc(h.rootFs, h.pid, "net/udp")
    if err != nil {
        klog.V(4).Infof("Unable to get udp stats from pid %d: %v", h.pid, err)
    } else {
        stats.Network.Udp = u
    }

    u6, err := udpStatsFromProc(h.rootFs, h.pid, "net/udp6")
    if err != nil {
        klog.V(4).Infof("Unable to get udp6 stats from pid %d: %v", h.pid, err)
    } else {
        stats.Network.Udp6 = u6
    }
}

However, I have observed that the UDP metrics obtained from these files tend to be of low quality because the values change very frequently, which can result in inconsistent and unreliable data.

To address this, I propose enhancing the UDP metrics by incorporating data from /proc/net/snmp. This file provides more comprehensive UDP statistics, similar to those already used for advanced TCP metrics. For example, /proc/net/snmp includes details like:

Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti
Udp: 174527561 8979 8 174548568 8 0 0 0

Integrating these metrics would offer valuable insights for deeper network analysis and troubleshooting.

I am willing to contribute by creating a PR to implement this enhancement.

Looking forward to your thoughts and feedback on this proposal.

Thank you!

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

No branches or pull requests

1 participant