← Back to Pull requests

report interface details on Windows and macOS #59183

Closed
unknown closed this pull request without merging on Nov 09, 2026 21:45 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 23:01 UTC
Author

<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !-->

What does this PR do?


It extends the Go network check (networkv2) on Windows and macOS to report details about each network interface.

  • New gauges for each interface: system.net.iface.up, system.net.iface.mtu and system.net.iface.speed.

  • - system.net.iface.speed is the negotiated link speed in Mbps. It is only reported for Ethernet interfaces.
    - The gauges are tagged with iface and iface_type (ethernet, wifi, cellular, loopback, tunnel, virtual or other). They also get duplex and vlan_id when the interface reports them.
  • New interfaces entry in the check's inventory metadata. It lists each interface's type, MAC address, permanent MAC address, MTU, duplex, VLAN ID, description and driver. On macOS it also says whether the interface is built in, and gives its vendor and model.

  • Windows: the details come from GetIfTable2Ex and from MSFT_NetAdapter (WMI, root\StandardCimv2). The WMI query runs in the background on its own SWbemServices client and is cached for 10 minutes, so a slow or stuck query never blocks the check.

  • macOS: the Go check can now be enabled with use_networkv2_check: true. It stays off by default on macOS.

  • - It reports the same metrics as the Python check, plus system.net.packets_in.drop and system.net.packets_out.drop.
    - Counters come from the net.link.generic.ifdata sysctl. Link state, speed, duplex, VLAN and functional type come from ioctls.
    - A new nicinfo cgo subpackage reads IOKit and SystemConfiguration for the description, permanent MAC, built-in flag, vendor, model and driver. The result is cached and refreshed when the interface list changes or every 10 minutes.
    - With collect_connection_state, the check also counts TCP connections in the SYN_RCVD, FIN_WAIT_1, FIN_WAIT_2 and CLOSED states. The Python check misses these because it looks for the Linux spellings.
  • Linux: unchanged, future work.

  • Motivation


    Need Ethernet adapter information (link state, speed, duplex, VLAN, MAC addresses and driver) for Windows and macOS hosts, especially end-user devices.

  • Linux already reports MTU and link state per interface, and carries speed as a tag. Windows and macOS report none of this today.

  • The shared interface model is meant to also fit a later Linux port.

  • Speed is limited to Ethernet on purpose:

  • - Windows reports made-up speeds for virtual adapters.
    - On macOS, the speed of a Wi-Fi interface could be a driver estimate.
    - The Wi-Fi link rate is already reported as system.wlan.txrate.

    Describe how you validated your changes


  • Unit tests (dda inv test --targets=./pkg/collector/corechecks/net/networkv2/...)

  • Live tests on macOS read the real interfaces through sysctl, ioctl and IOKit.

  • Manual run on macOS (Apple silicon): Run DD_USE_NETWORKV2_CHECK=true agent check network with a locally built agent and checked the gauges and the interfaces metadata. For example:

  • - Wi-Fi reported its permanent MAC and its DriverKit driver.
    - The Thunderbolt IP ports were typed other.
    - The USB device-mode interfaces were typed virtual.
  • Similar local tests on Windows

  • Additional Notes


  • Related PR: #58695, now merged, fixed the host metadata path so that per-interface MAC addresses and networks reach the inventory-host payload. This PR adds the interface details to the network check and doesn't depend on that change.
  • Diff: 440 lines (+330 / -110) across 5 files Reviewer: hush-hush Review duration: 17203m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.45) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 440 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.364
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #59183"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.3% (MEDIUM) · Higher = larger blast radius
    45.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.6% · Safe to merge
    19.6%