Skip to content

Comments

Add a new ethtool stats collector#1832

Merged
SuperQ merged 5 commits intoprometheus:masterfrom
ventifus:master
Jun 16, 2021
Merged

Add a new ethtool stats collector#1832
SuperQ merged 5 commits intoprometheus:masterfrom
ventifus:master

Conversation

@ventifus
Copy link
Contributor

@ventifus ventifus commented Sep 2, 2020

This adds a new collector for Linux to gather "ethtool" stats, the same as "ethtool -S" provides. This is collected by using the SIOCETHTOOL ioctl.

Some questions and comments:

  • I have copied and pasted code from the "github.com/safchain/ethtool" project. Would it be preferable to just add that as a dependency?
  • I have borrowed code from elsewhere in node_exporter to enumerate network devices. Is there a common function to do so? Only physical devices support the ethtool metrics, so if a network device returns an error it just skips it and keeps going.
  • On most systems, this collector is fast and returns a limited number of metrics. But on some systems there are quite a lot. The server I developed this for has a Mellanox card with many queues and so returns 6,500 ethtool metrics in 0.05 seconds. Is that reason to default it off?
  • Some ethtool stats are counters, some are gauges and there's no way that I know of to tell. What type should I use? It's a GaugeValue right now.

Here is some example output:

node_ethtool_stats{device="ens4u1u2",stat="align_errors"} 0
node_ethtool_stats{device="ens4u1u2",stat="rx_broadcast"} 3598
node_ethtool_stats{device="ens4u1u2",stat="rx_errors"} 0
node_ethtool_stats{device="ens4u1u2",stat="rx_missed"} 0
node_ethtool_stats{device="ens4u1u2",stat="rx_multicast"} 7905
node_ethtool_stats{device="ens4u1u2",stat="rx_packets"} 112652
node_ethtool_stats{device="ens4u1u2",stat="rx_unicast"} 101149
node_ethtool_stats{device="ens4u1u2",stat="tx_aborted"} 0
node_ethtool_stats{device="ens4u1u2",stat="tx_errors"} 0
node_ethtool_stats{device="ens4u1u2",stat="tx_multi_collisions"} 0
node_ethtool_stats{device="ens4u1u2",stat="tx_packets"} 85931
node_ethtool_stats{device="ens4u1u2",stat="tx_single_collisions"} 0
node_ethtool_stats{device="ens4u1u2",stat="tx_underrun"} 0
node_ethtool_stats{device="wlp2s0",stat="ch_time"} 150
node_ethtool_stats{device="wlp2s0",stat="ch_time_busy"} 3
node_ethtool_stats{device="wlp2s0",stat="ch_time_ext_busy"} 1.8446744073709552e+19
node_ethtool_stats{device="wlp2s0",stat="ch_time_rx"} 1.8446744073709552e+19
node_ethtool_stats{device="wlp2s0",stat="ch_time_tx"} 1.8446744073709552e+19
node_ethtool_stats{device="wlp2s0",stat="channel"} 5240
node_ethtool_stats{device="wlp2s0",stat="d_cycle_count"} 1.1884801e+07
node_ethtool_stats{device="wlp2s0",stat="d_fw_cold_reset_count"} 5
node_ethtool_stats{device="wlp2s0",stat="d_fw_crash_count"} 0
node_ethtool_stats{device="wlp2s0",stat="d_fw_warm_reset_count"} 8
node_ethtool_stats{device="wlp2s0",stat="d_local_enqued"} 2126
node_ethtool_stats{device="wlp2s0",stat="d_local_freed"} 2126
node_ethtool_stats{device="wlp2s0",stat="d_no_beacon"} 0
node_ethtool_stats{device="wlp2s0",stat="d_noise_floor"} 1.8446744073709552e+19
node_ethtool_stats{device="wlp2s0",stat="d_pdev_resets"} 3
node_ethtool_stats{device="wlp2s0",stat="d_phy_error"} 11
node_ethtool_stats{device="wlp2s0",stat="d_rts_bad"} 0
node_ethtool_stats{device="wlp2s0",stat="d_rts_good"} 0
node_ethtool_stats{device="wlp2s0",stat="d_rx_crc_err"} 0
node_ethtool_stats{device="wlp2s0",stat="d_rx_crc_err_drop"} 0
node_ethtool_stats{device="wlp2s0",stat="d_rx_extra_frags_ring0"} 0
node_ethtool_stats{device="wlp2s0",stat="d_rx_extra_frags_ring1"} 2
node_ethtool_stats{device="wlp2s0",stat="d_rx_extra_frags_ring2"} 93
node_ethtool_stats{device="wlp2s0",stat="d_rx_extra_frags_ring3"} 0
node_ethtool_stats{device="wlp2s0",stat="d_rx_mid_ppdu_route_change"} 1
node_ethtool_stats{device="wlp2s0",stat="d_rx_mpdu_errors"} 2796
node_ethtool_stats{device="wlp2s0",stat="d_rx_mpdu_htt"} 42913
node_ethtool_stats{device="wlp2s0",stat="d_rx_mpdu_stack"} 23430
node_ethtool_stats{device="wlp2s0",stat="d_rx_msdu_htt"} 58646
node_ethtool_stats{device="wlp2s0",stat="d_rx_msdu_stack"} 23430
node_ethtool_stats{device="wlp2s0",stat="d_rx_phy_err"} 0
node_ethtool_stats{device="wlp2s0",stat="d_rx_phy_err_drops"} 10
node_ethtool_stats{device="wlp2s0",stat="d_rx_status"} 82130
node_ethtool_stats{device="wlp2s0",stat="d_tx_continuous_xretries"} 0
node_ethtool_stats{device="wlp2s0",stat="d_tx_dropped_sw_retries"} 0
node_ethtool_stats{device="wlp2s0",stat="d_tx_excessive_retries"} 1793
node_ethtool_stats{device="wlp2s0",stat="d_tx_fifo_underrun"} 0
node_ethtool_stats{device="wlp2s0",stat="d_tx_hw_rate"} 3
node_ethtool_stats{device="wlp2s0",stat="d_tx_illegal_rate"} 0
node_ethtool_stats{device="wlp2s0",stat="d_tx_mpdu_requed"} 3009
node_ethtool_stats{device="wlp2s0",stat="d_tx_mpdu_txop_limit"} 0
node_ethtool_stats{device="wlp2s0",stat="d_tx_mpdus_queued"} 13705
node_ethtool_stats{device="wlp2s0",stat="d_tx_msdu_dropped"} 0
node_ethtool_stats{device="wlp2s0",stat="d_tx_msdu_queued"} 27014
node_ethtool_stats{device="wlp2s0",stat="d_tx_power"} 26
node_ethtool_stats{device="wlp2s0",stat="d_tx_ppdu_abort"} 0
node_ethtool_stats{device="wlp2s0",stat="d_tx_ppdu_hw_queued"} 11644
node_ethtool_stats{device="wlp2s0",stat="d_tx_ppdu_reaped"} 11644
node_ethtool_stats{device="wlp2s0",stat="d_tx_timeout"} 0
node_ethtool_stats{device="wlp2s0",stat="noise"} 164
node_ethtool_stats{device="wlp2s0",stat="rx_bytes"} 7.4115642e+07
node_ethtool_stats{device="wlp2s0",stat="rx_bytes_nic"} 0
node_ethtool_stats{device="wlp2s0",stat="rx_dropped"} 11
node_ethtool_stats{device="wlp2s0",stat="rx_duplicates"} 0
node_ethtool_stats{device="wlp2s0",stat="rx_fragments"} 76465
node_ethtool_stats{device="wlp2s0",stat="rx_packets"} 99735
node_ethtool_stats{device="wlp2s0",stat="rx_pkts_nic"} 42913
node_ethtool_stats{device="wlp2s0",stat="rxrate"} 3.9e+08
node_ethtool_stats{device="wlp2s0",stat="signal"} 199
node_ethtool_stats{device="wlp2s0",stat="sta_state"} 4
node_ethtool_stats{device="wlp2s0",stat="tx_bytes"} 3.315595e+06
node_ethtool_stats{device="wlp2s0",stat="tx_bytes_nic"} 0
node_ethtool_stats{device="wlp2s0",stat="tx_filtered"} 0
node_ethtool_stats{device="wlp2s0",stat="tx_packets"} 24890
node_ethtool_stats{device="wlp2s0",stat="tx_pkts_nic"} 11644
node_ethtool_stats{device="wlp2s0",stat="tx_retries"} 0
node_ethtool_stats{device="wlp2s0",stat="tx_retry_failed"} 0
node_ethtool_stats{device="wlp2s0",stat="txrate"} 6e+06
node_scrape_collector_duration_seconds{collector="ethtool"} 0.031492675
node_scrape_collector_success{collector="ethtool"} 1

Signed-off-by: W Andrew Denton ventifus@flying-snail.net

@SuperQ
Copy link
Member

SuperQ commented Sep 2, 2020

Interesting, last time I looked into ethtool metrics, everything required root access.

We don't allow collectors that require privileged system access in the node_exporter. It's expected to work fine nobody for example.

To answer your other questions:

  • Yes, we typically prefer importing other project libraries like github.com/safchain/ethtool rather than copy-n-paste. This allows us to track the upstream code for bug fixes and features.
  • I don't have a quick answer on the device list. The usual thing I would suggest is refactoring the required code into reusable functions.
  • Yes, this is probably something we might want to have off by default.
  • If you don't know if it's counter or gauge, there's an UntypedValue you can use.

@ventifus
Copy link
Contributor Author

ventifus commented Sep 2, 2020

Thanks for the feedback, I'll modify it so to include a dependency on safchain/ethtool. Likewise switch to UntypedValue.

I tested non-root access and the only system I found where it didn't work was CentOS 6. On CentOS 7 and 8 it works fine unprivileged. I'll see if I can find out specifically in which kernel version this changed.

@SuperQ
Copy link
Member

SuperQ commented Sep 2, 2020

Thanks, documenting where it does/doesn't work is probably good enough. When you think this is ready for more testing, let me know.

One thing that would be nice is if we could have tests for this.

@ventifus
Copy link
Contributor Author

ventifus commented Sep 2, 2020

The removal of CAP_NET_ADMIN from querying ethtool was in commit:

0fdc100bdc4b7ab61ed632962c76dfe539047296 ethtool: allow non-netadmin to query settings

The mentioned commit landed first in the 2.6.37, so CentOS 6 just missed out. It's only going to be with us until November, and no other still supported LTS distro I checked (Ubuntu, Debian, SUSE) still runs a 2.x kernel.

I'll look into writing tests next.

@aned
Copy link

aned commented Mar 3, 2021

This would be a nice feature to have indeed!
On RH7 no need for root access, used this https://github.com/Showmax/prometheus-ethtool-exporter
and got these metrics:

# HELP node_net_ethtool_info Ethtool device information
# TYPE node_net_ethtool_info gauge
node_net_ethtool_info{device="enp179s0f0",duplex="Full",link_detected="yes",port="Direct Attach Copper",speed="25000000000.0"} 1.0
node_net_ethtool_info{device="enp179s0f1",duplex="Unknown! (255)",link_detected="no",port="FIBRE",speed="0"} 1.0
node_net_ethtool_info{device="enp180s0f1",duplex="Unknown! (255)",link_detected="no",port="FIBRE",speed="0"} 1.0
node_net_ethtool_info{device="enp180s0f0",duplex="Unknown! (255)",link_detected="no",port="FIBRE",speed="0"} 1.0
# HELP node_net_ethtool_xcvr_info Ethtool device transceiver information
# TYPE node_net_ethtool_xcvr_info gauge
# HELP node_net_ethtool_xcvr_sensors Ethtool transceiver sensors
# TYPE node_net_ethtool_xcvr_sensors gauge
# HELP node_net_ethtool_xcvr_alarms Ethtool transceiver sensor alarms
# TYPE node_net_ethtool_xcvr_alarms gauge
# HELP node_net_ethtool Ethtool data
# TYPE node_net_ethtool gauge
node_net_ethtool{device="enp179s0f0",type="rx_pause_ctrl_phy"} 202.0
node_net_ethtool{device="enp179s0f0",type="tx_pause_ctrl_phy"} 0.0
node_net_ethtool{device="enp179s0f0",type="rx_prio0_bytes"} 6.913362843215e+012
node_net_ethtool{device="enp179s0f0",type="rx_prio0_packets"} 4.624401907e+09
node_net_ethtool{device="enp179s0f0",type="rx_prio0_discards"} 0.0
node_net_ethtool{device="enp179s0f0",type="tx_prio0_bytes"} 2.420924060405e+012
node_net_ethtool{device="enp179s0f0",type="tx_prio0_packets"} 1.702154084e+09
node_net_ethtool{device="enp179s0f0",type="rx_prio3_bytes"} 7.949712168564e+012
node_net_ethtool{device="enp179s0f0",type="rx_prio3_packets"} 9.288067704e+09
node_net_ethtool{device="enp179s0f0",type="rx_prio3_discards"} 0.0
node_net_ethtool{device="enp179s0f0",type="tx_prio3_bytes"} 3.913131640952e+012
node_net_ethtool{device="enp179s0f0",type="tx_prio3_packets"} 5.674199976e+09
node_net_ethtool{device="enp179s0f0",type="rx_prio6_bytes"} 1.452203e+06
node_net_ethtool{device="enp179s0f0",type="rx_prio6_packets"} 10843.0
node_net_ethtool{device="enp179s0f0",type="rx_prio6_discards"} 0.0
node_net_ethtool{device="enp179s0f0",type="tx_prio6_bytes"} 1.8841576334e+010
node_net_ethtool{device="enp179s0f0",type="tx_prio6_packets"} 2.29765201e+08
node_net_ethtool{device="enp179s0f0",type="rx_prio3_pause"} 202.0
node_net_ethtool{device="enp179s0f0",type="rx_prio3_pause_duration"} 150.0
node_net_ethtool{device="enp179s0f0",type="tx_prio3_pause"} 0.0
node_net_ethtool{device="enp179s0f0",type="tx_prio3_pause_duration"} 0.0
node_net_ethtool{device="enp179s0f0",type="rx_prio3_pause_transition"} 101.0
node_net_ethtool{device="enp179s0f0",type="tx_pause_storm_warning_events"} 0.0
node_net_ethtool{device="enp179s0f0",type="tx_pause_storm_error_events"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_pause_ctrl_phy"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_pause_ctrl_phy"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio0_bytes"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio0_packets"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio0_discards"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_prio0_bytes"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_prio0_packets"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio3_bytes"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio3_packets"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio3_discards"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_prio3_bytes"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_prio3_packets"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio6_bytes"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio6_packets"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_prio6_discards"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_prio6_bytes"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_prio6_packets"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_global_pause"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_global_pause_duration"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_global_pause"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_global_pause_duration"} 0.0
node_net_ethtool{device="enp179s0f1",type="rx_global_pause_transition"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_pause_storm_warning_events"} 0.0
node_net_ethtool{device="enp179s0f1",type="tx_pause_storm_error_events"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_pause_ctrl_phy"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_pause_ctrl_phy"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio0_bytes"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio0_packets"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio0_discards"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_prio0_bytes"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_prio0_packets"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio3_bytes"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio3_packets"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio3_discards"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_prio3_bytes"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_prio3_packets"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio6_bytes"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio6_packets"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_prio6_discards"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_prio6_bytes"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_prio6_packets"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_global_pause"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_global_pause_duration"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_global_pause"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_global_pause_duration"} 0.0
node_net_ethtool{device="enp180s0f1",type="rx_global_pause_transition"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_pause_storm_warning_events"} 0.0
node_net_ethtool{device="enp180s0f1",type="tx_pause_storm_error_events"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_pause_ctrl_phy"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_pause_ctrl_phy"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio0_bytes"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio0_packets"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio0_discards"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_prio0_bytes"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_prio0_packets"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio3_bytes"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio3_packets"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio3_discards"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_prio3_bytes"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_prio3_packets"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio6_bytes"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio6_packets"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_prio6_discards"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_prio6_bytes"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_prio6_packets"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_global_pause"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_global_pause_duration"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_global_pause"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_global_pause_duration"} 0.0
node_net_ethtool{device="enp180s0f0",type="rx_global_pause_transition"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_pause_storm_warning_events"} 0.0
node_net_ethtool{device="enp180s0f0",type="tx_pause_storm_error_events"} 0.0

Would be really nice if it was integrated directly into node_exporter.

@SuperQ
Copy link
Member

SuperQ commented Mar 3, 2021

Thinking about this some more, I don't like the use of dumping random stats as different labels. Labels are meant to have aggregation meanings, not just tag random things.

Similar to other collectors, I think we need to parse the list of returned stats and convert them into meaningful metric names.

@ventifus
Copy link
Contributor Author

ventifus commented Mar 3, 2021

Thank you for the feedback! Would just concatenating metric names like node_ethtool_stats_d_rx_extra_frags_ring2 be acceptable? It would be challenging to make them conform to the OpenMetrics style suffixes (_count, _sum, etc) since they are driver-dependent.

@ventifus
Copy link
Contributor Author

ventifus commented Mar 4, 2021

I've changed the metric names to now be a concatenation of "node_ethtool" plus ethtool's stat name. Metrics now look like:

# HELP node_ethtool_rx_multicast Network interface rx_multicast
# TYPE node_ethtool_rx_multicast untyped
node_ethtool_rx_multicast{device="ens4u1u2"} 48375
# HELP node_ethtool_rx_packets_total Network interface packets received
# TYPE node_ethtool_rx_packets_total untyped
node_ethtool_rx_packets_total{device="ens4u1u2"} 2.432839e+06
node_ethtool_rx_packets_total{device="wlp2s0"} 292417
# HELP node_ethtool_rx_pkts_nic Network interface rx_pkts_nic
# TYPE node_ethtool_rx_pkts_nic untyped
node_ethtool_rx_pkts_nic{device="wlp2s0"} 23330
# HELP node_ethtool_rx_unicast Network interface rx_unicast
# TYPE node_ethtool_rx_unicast untyped
node_ethtool_rx_unicast{device="ens4u1u2"} 2.375017e+06
# HELP node_ethtool_rxrate Network interface rxrate
# TYPE node_ethtool_rxrate untyped
node_ethtool_rxrate{device="wlp2s0"} 2.34e+08

How does it look to you now?

@ventifus ventifus requested a review from SuperQ March 4, 2021 20:05
@discordianfish
Copy link
Member

How do all metrics look like now? Even better, can you add tests for this?

@ventifus
Copy link
Contributor Author

And now there are tests! You can see what the metrics look like in e2e-output.txt.

@aned
Copy link

aned commented Apr 20, 2021

Almost there folks, lets make it happen!

…htool -S")

Signed-off-by: W. Andrew Denton <git@flying-snail.net>
@ventifus
Copy link
Contributor Author

I've refactored the tests to use an interface to ethtool to allow swapping out the real tool for the test fixture. What do you think now? The bulk of the fixture stuff does still need to live with the main code to allow it to be activated at runtime for end-to-end-test.sh.

@ventifus ventifus requested a review from discordianfish April 29, 2021 18:36
@idosch
Copy link

idosch commented May 2, 2021

FYI, kernel 5.13 will support standardized ethtool statistics:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1c86514d7fda55c5311c6b75aacb8c41b2e83999
https://people.kernel.org/kuba/common-interface-for-nic-statistics

It makes use of the new ethtool netlink interface, not the ioctl interface used here.

@discordianfish
Copy link
Member

This still leaks test stuff into the main binary which I'd like to avoid. I don't have time to provide more detailed guides though. Maybe best to ask on the mailinglist for help.

@ventifus
Copy link
Contributor Author

ventifus commented May 3, 2021

Hi @discordianfish , including test stuff into the main binary is required for "end-to-end-test.sh" support. I can remove that code and make the tests entirely separate if that's preferable.

Signed-off-by: W. Andrew Denton <git@flying-snail.net>
@ventifus
Copy link
Contributor Author

ventifus commented May 3, 2021

@idosch thanks for the note, I'll see about getting support for that into mdlayher/ethtool which will let me add them here.

@discordianfish
Copy link
Member

Just realized we have prior art for this. So guess that's fine then for now:

collectorWifi = kingpin.Flag("collector.wifi.fixtures", "test fixtures to use for wifi collector metrics").Default("").String()

@ventifus
Copy link
Contributor Author

ventifus commented May 7, 2021

Right, the wifi and qdisc collectors are like that. Anything that wants to be runtime testable and needs data outside the /proc and /sys filesystems will need something similar.

Signed-off-by: W. Andrew Denton <git@flying-snail.net>
Signed-off-by: W. Andrew Denton <git@flying-snail.net>
Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ton31337
Copy link

ton31337 commented Jun 2, 2021

Any ETA this can be pulled into master?

@discordianfish
Copy link
Member

ping @SuperQ @pgier

Signed-off-by: W. Andrew Denton <git@flying-snail.net>

Co-authored-by: Manuel Rüger <manuel@rueg.eu>
Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ SuperQ merged commit 27dc754 into prometheus:master Jun 16, 2021
@aned
Copy link

aned commented Jun 16, 2021

Getting this error when I'm trying to build it:

GOOS=linux GOARCH=amd64 make

>> checking code style
>> checking license header
>> running golangci-lint
GO111MODULE=on go list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
GO111MODULE=on /Users/blah/.gvm/pkgsets/go1.16.5/global/bin/golangci-lint run  ./...
collector/ethtool_linux.go:116:48: cannot use NewEthtoolCollector (value of type func(logger "github.com/go-kit/kit/log".Logger) (Collector, error)) as func(logger "github.com/go-kit/log".Logger) (Collector, error) value in argument to registerCollector (typecheck)
	registerCollector("ethtool", defaultDisabled, NewEthtoolCollector)
	                                              ^
make: *** [common-lint] Error 1

@ventifus
Copy link
Contributor Author

I should have rebased to head after 3bc9a93 switched from go-kit/kit/log to go-kit/log. It looks like PR #2055 has the fix for this.

SuperQ added a commit that referenced this pull request Jul 12, 2021
NOTE: Ignoring invalid network speed will be the default in 2.x
NOTE: Filesystem collector flags have been renamed. `--collector.filesystem.ignored-mount-points` is now `--collector.filesystem.mount-points-exclude` and `--collector.filesystem.ignored-fs-types` is now `--collector.filesystem.fs-types-exclude`. The old flags will be removed in 2.x.

* [CHANGE] Rename filesystem collector flags to match other collectors #2012
* [CHANGE] Make node_exporter print usage to STDOUT #2039
* [FEATURE] Add conntrack statistics metrics #1155
* [FEATURE] Add ethtool stats collector #1832
* [FEATURE] Add flag to ignore network speed if it is unknown #1989
* [FEATURE] Add tapestats collector for Linux #2044
* [ENHANCEMENT] Add ErrorLog plumbing to promhttp #1887
* [ENHANCEMENT] Add time zone offset metric #2060
* [BUGFIX] Add ErrorLog plumbing to promhttp #1887
* [BUGFIX] Handle errors from disabled PSI subsystem #1983
* [BUGFIX] Fix panic when using backwards compatible flags #2000
* [BUGFIX] Only initiate collectors once #2048
* [BUGFIX] Handle small backwards jumps in CPU idle #2067

Signed-off-by: Ben Kochie <superq@gmail.com>
@SuperQ SuperQ mentioned this pull request Jul 12, 2021
SuperQ added a commit that referenced this pull request Jul 15, 2021
NOTE: Ignoring invalid network speed will be the default in 2.x
NOTE: Filesystem collector flags have been renamed. `--collector.filesystem.ignored-mount-points` is now `--collector.filesystem.mount-points-exclude` and `--collector.filesystem.ignored-fs-types` is now `--collector.filesystem.fs-types-exclude`. The old flags will be removed in 2.x.

* [CHANGE] Rename filesystem collector flags to match other collectors #2012
* [CHANGE] Make node_exporter print usage to STDOUT #2039
* [FEATURE] Add conntrack statistics metrics #1155
* [FEATURE] Add ethtool stats collector #1832
* [FEATURE] Add flag to ignore network speed if it is unknown #1989
* [FEATURE] Add tapestats collector for Linux #2044
* [FEATURE] Add nvme collector #2062
* [ENHANCEMENT] Add ErrorLog plumbing to promhttp #1887
* [ENHANCEMENT] Add more Infiniband counters #2019
* [ENHANCEMENT] netclass: retrieve interface names and filter before parsing #2033
* [ENHANCEMENT] Add time zone offset metric #2060
* [BUGFIX] Handle errors from disabled PSI subsystem #1983
* [BUGFIX] Fix panic when using backwards compatible flags #2000
* [BUGFIX] Fix wrong value for OpenBSD memory buffer cache #2015
* [BUGFIX] Only initiate collectors once #2048
* [BUGFIX] Handle small backwards jumps in CPU idle #2067

Signed-off-by: Ben Kochie <superq@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
NOTE: Ignoring invalid network speed will be the default in 2.x
NOTE: Filesystem collector flags have been renamed. `--collector.filesystem.ignored-mount-points` is now `--collector.filesystem.mount-points-exclude` and `--collector.filesystem.ignored-fs-types` is now `--collector.filesystem.fs-types-exclude`. The old flags will be removed in 2.x.

* [CHANGE] Rename filesystem collector flags to match other collectors prometheus#2012
* [CHANGE] Make node_exporter print usage to STDOUT prometheus#2039
* [FEATURE] Add conntrack statistics metrics prometheus#1155
* [FEATURE] Add ethtool stats collector prometheus#1832
* [FEATURE] Add flag to ignore network speed if it is unknown prometheus#1989
* [FEATURE] Add tapestats collector for Linux prometheus#2044
* [FEATURE] Add nvme collector prometheus#2062
* [ENHANCEMENT] Add ErrorLog plumbing to promhttp prometheus#1887
* [ENHANCEMENT] Add more Infiniband counters prometheus#2019
* [ENHANCEMENT] netclass: retrieve interface names and filter before parsing prometheus#2033
* [ENHANCEMENT] Add time zone offset metric prometheus#2060
* [BUGFIX] Handle errors from disabled PSI subsystem prometheus#1983
* [BUGFIX] Fix panic when using backwards compatible flags prometheus#2000
* [BUGFIX] Fix wrong value for OpenBSD memory buffer cache prometheus#2015
* [BUGFIX] Only initiate collectors once prometheus#2048
* [BUGFIX] Handle small backwards jumps in CPU idle prometheus#2067

Signed-off-by: Ben Kochie <superq@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
NOTE: Ignoring invalid network speed will be the default in 2.x
NOTE: Filesystem collector flags have been renamed. `--collector.filesystem.ignored-mount-points` is now `--collector.filesystem.mount-points-exclude` and `--collector.filesystem.ignored-fs-types` is now `--collector.filesystem.fs-types-exclude`. The old flags will be removed in 2.x.

* [CHANGE] Rename filesystem collector flags to match other collectors prometheus#2012
* [CHANGE] Make node_exporter print usage to STDOUT prometheus#2039
* [FEATURE] Add conntrack statistics metrics prometheus#1155
* [FEATURE] Add ethtool stats collector prometheus#1832
* [FEATURE] Add flag to ignore network speed if it is unknown prometheus#1989
* [FEATURE] Add tapestats collector for Linux prometheus#2044
* [FEATURE] Add nvme collector prometheus#2062
* [ENHANCEMENT] Add ErrorLog plumbing to promhttp prometheus#1887
* [ENHANCEMENT] Add more Infiniband counters prometheus#2019
* [ENHANCEMENT] netclass: retrieve interface names and filter before parsing prometheus#2033
* [ENHANCEMENT] Add time zone offset metric prometheus#2060
* [BUGFIX] Handle errors from disabled PSI subsystem prometheus#1983
* [BUGFIX] Fix panic when using backwards compatible flags prometheus#2000
* [BUGFIX] Fix wrong value for OpenBSD memory buffer cache prometheus#2015
* [BUGFIX] Only initiate collectors once prometheus#2048
* [BUGFIX] Handle small backwards jumps in CPU idle prometheus#2067

Signed-off-by: Ben Kochie <superq@gmail.com>
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.

7 participants