Skip to content

Conversation

@quatre
Copy link
Contributor

@quatre quatre commented May 16, 2025

The ethtool_linux looks for ethtool stats with their sanitized name which might be different from the name provisioned by ethtool.

This caused node-exporter to return a 0-value for sanitized metrics.

This patch works-around the missing key by copying ethtool stats to their sanitized name.

@SuperQ
Copy link
Member

SuperQ commented May 18, 2025

--- FAIL: TestEthToolCollector (0.00s)
    ethtool_linux_test.go:401:  # HELP node_ethtool_align_errors Network interface align_errors
         # TYPE node_ethtool_align_errors untyped
         node_ethtool_align_errors{device="eth0"} 0
         # HELP node_ethtool_info A metric with a constant '1' value labeled by bus_info, device, driver, expansion_rom_version, firmware_version, version.
         # TYPE node_ethtool_info gauge
         node_ethtool_info{bus_info="0000:00:1f.6",device="eth0",driver="e1000e",expansion_rom_version="",firmware_version="0.5-4",version="5.11.0-22-generic"} 1
        +# HELP node_ethtool_port_received_dropped Network interface port_rx_dropped
        +# TYPE node_ethtool_port_received_dropped untyped
        +node_ethtool_port_received_dropped{device="eth0"} 12028
         # HELP node_ethtool_received_broadcast Network interface rx_broadcast
         # TYPE node_ethtool_received_broadcast untyped

@quatre
Copy link
Contributor Author

quatre commented May 18, 2025

Hey! It's not really clear to me why this is not passing. Any idea? Anyway, I'll revisit on Monday!

The ethtool_linux looks for ethtool stats with their sanitized name
which might be different from the name provisioned by ethtool.

This caused node-exporter to return a 0-value for sanitized metrics.

This patch works-around the missing key by copying ethtool stats
to another map under their sanitized name.

Signed-off-by: Guillaume Espanel <[email protected]>
@SuperQ SuperQ merged commit 45eb59d into prometheus:master May 19, 2025
13 checks passed
SuperQ added a commit that referenced this pull request Oct 22, 2025
* [CHANGE] mdadm: Use sysfs for RAID metrics #3031
* [CHANGE] filesystem: Add erofs in default excluded fs #3313
* [CHANGE] tcpstat: Use std lib binary.NativeEndian #3386
* [FEATURE] pcidevice: Add new collector for PCIe devices #3339
* [FEATURE] AIX: Add more metrics #3338
* [FEATURE] systemd: Add Virtualization metrics #3254
* [FEATURE] swaps: Add new collector #3428
* [ENHANCEMENT] filesystem: Take super options into account for read-only #3387
* [ENHANCEMENT] perf: Add tlb_data metrics #3436
* [BUGFIX] interrupts: Fix OpenBSD interrupt device parsing #3288
* [BUGFIX] diskstats: Simplify condition #3290
* [BUGFIX] thermal: Sanitize darwin thermal strings #3294
* [BUGFIX] filesystem: Fix Darwin collector cgo memory leak #3315
* [BUGFIX] ethtool: Fix returning 0 for sanitized metrics #3335
* [BUGFIX] netdev: Fix Darwin netdev i/o bytes metric #3336
* [BUGFIX] systemd: Fix logging race #3364
* [BUGFIX] filesystem: Fix duplicate Darwin CGO import #3391

Signed-off-by: Ben Kochie <[email protected]>
@SuperQ SuperQ mentioned this pull request Oct 22, 2025
SuperQ added a commit that referenced this pull request Oct 23, 2025
* [CHANGE] mdadm: Use sysfs for RAID metrics #3031
* [CHANGE] filesystem: Add erofs in default excluded fs #3313
* [CHANGE] tcpstat: Use std lib binary.NativeEndian #3386
* [FEATURE] pcidevice: Add new collector for PCIe devices #3339
* [FEATURE] AIX: Add more metrics #3338
* [FEATURE] systemd: Add Virtualization metrics #3254
* [FEATURE] swaps: Add new collector #3428
* [ENHANCEMENT] filesystem: Take super options into account for read-only #3387
* [ENHANCEMENT] perf: Add tlb_data metrics #3436
* [BUGFIX] interrupts: Fix OpenBSD interrupt device parsing #3288
* [BUGFIX] diskstats: Simplify condition #3290
* [BUGFIX] thermal: Sanitize darwin thermal strings #3294
* [BUGFIX] filesystem: Fix Darwin collector cgo memory leak #3315
* [BUGFIX] ethtool: Fix returning 0 for sanitized metrics #3335
* [BUGFIX] netdev: Fix Darwin netdev i/o bytes metric #3336
* [BUGFIX] systemd: Fix logging race #3364
* [BUGFIX] filesystem: Fix duplicate Darwin CGO import #3391

Signed-off-by: Ben Kochie <[email protected]>
SuperQ added a commit that referenced this pull request Oct 24, 2025
* [CHANGE] mdadm: Use sysfs for RAID metrics #3031
* [CHANGE] filesystem: Add erofs in default excluded fs #3313
* [CHANGE] tcpstat: Use std lib binary.NativeEndian #3386
* [FEATURE] pcidevice: Add new collector for PCIe devices #3339
* [FEATURE] AIX: Add more metrics #3338
* [FEATURE] systemd: Add Virtualization metrics #3254
* [FEATURE] swaps: Add new collector #3428
* [ENHANCEMENT] filesystem: Take super options into account for read-only #3387
* [ENHANCEMENT] perf: Add tlb_data metrics #3436
* [BUGFIX] interrupts: Fix OpenBSD interrupt device parsing #3288
* [BUGFIX] diskstats: Simplify condition #3290
* [BUGFIX] thermal: Sanitize darwin thermal strings #3294
* [BUGFIX] filesystem: Fix Darwin collector cgo memory leak #3315
* [BUGFIX] ethtool: Fix returning 0 for sanitized metrics #3335
* [BUGFIX] netdev: Fix Darwin netdev i/o bytes metric #3336
* [BUGFIX] systemd: Fix logging race #3364
* [BUGFIX] filesystem: Fix duplicate Darwin CGO import #3391

Signed-off-by: Ben Kochie <[email protected]>
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.

2 participants