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 advanced udp metrics #3659

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Andrewmatilde
Copy link

Add Advanced UDP Statistics

What

Add advanced UDP statistics for problem diagnosis, sourcing data from /proc/net/snmp. Currently, cAdvisor only retrieves basic UDP metrics from /proc/net/udp and /proc/net/udp6, which tend to be unreliable due to frequent value changes.
related: #3657

Why

  • Current UDP metrics are of low quality due to frequent value changes leading to inconsistent data
  • /proc/net/snmp provides more comprehensive UDP statistics, similar to existing advanced TCP metrics

How

  1. Add new UdpAdvancedStat structure with the following fields:
  • InDatagrams - Total number of datagrams successfully received
  • NoPorts - Number of datagrams discarded due to no available ports
  • InErrors - Number of datagrams discarded due to errors
  • OutDatagrams - Total number of datagrams successfully transmitted
  • RcvbufErrors - Number of datagrams dropped due to insufficient receive buffer
  • SndbufErrors - Number of datagrams dropped due to insufficient send buffer
  • InCsumErrors - Number of datagrams discarded due to checksum errors
  • IgnoredMulti - Number of datagrams discarded due to ignored multicast
  1. Parse these metrics from /proc/net/snmp and add them to container statistics

Example output:

"udp_advanced": {
    "InDatagrams": 174527561,
    "NoPorts": 8979,
    "InErrors": 8,
    "OutDatagrams": 174548568,
    "RcvbufErrors": 8,
    "SndbufErrors": 0,
    "InCsumErrors": 0,
    "IgnoredMulti": 0
}

Testing

  • Added unit tests to verify UDP statistics parsing from /proc/net/snmp
  • Manually tested metric collection

@Andrewmatilde Andrewmatilde changed the title Add udp metrics Add advanced udp metrics Feb 18, 2025
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

Successfully merging this pull request may close these issues.

1 participant