Skip to content

Commit

Permalink
Rename interface to device in netclass collector (prometheus#1224)
Browse files Browse the repository at this point in the history
* Rename interface to device in netclass collector

This makes it consistent with other networking metrics like node_network_receive_bytes_total

This closes prometheus#1223 

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
  • Loading branch information
discordianfish authored and SuperQ committed Feb 6, 2019
1 parent 3867ad5 commit 6ea0aa7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

### **Breaking changes**

The cpufreq metrics now separate the `cpufreq` and `scaling` data based on what the driver provides. #1248
* Renamed `interface` label to `device` in netclass collector for consistency with
other network metrics #1224
* The cpufreq metrics now separate the `cpufreq` and `scaling` data based on what the driver provides. #1248

### Changes

* [BUGFIX]
* [CHANGE] Renamed `interface` label to `device` in netclass collector #1224
* [BUGFIX] Add fallback for missing /proc/1/mounts #1172
* [CHANGE] Add TCPSynRetrans to netstat default filter #1143
* [CHANGE] Add a limit to the number of in-flight requests #1166
Expand Down
38 changes: 19 additions & 19 deletions collector/fixtures/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1804,49 +1804,49 @@ node_netstat_Udp_NoPorts 120
node_netstat_Udp_OutDatagrams 53028
# HELP node_network_address_assign_type address_assign_type value of /sys/class/net/<iface>.
# TYPE node_network_address_assign_type gauge
node_network_address_assign_type{interface="eth0"} 3
node_network_address_assign_type{device="eth0"} 3
# HELP node_network_carrier carrier value of /sys/class/net/<iface>.
# TYPE node_network_carrier gauge
node_network_carrier{interface="eth0"} 1
node_network_carrier{device="eth0"} 1
# HELP node_network_carrier_changes_total carrier_changes_total value of /sys/class/net/<iface>.
# TYPE node_network_carrier_changes_total counter
node_network_carrier_changes_total{interface="eth0"} 2
node_network_carrier_changes_total{device="eth0"} 2
# HELP node_network_carrier_down_changes_total carrier_down_changes_total value of /sys/class/net/<iface>.
# TYPE node_network_carrier_down_changes_total counter
node_network_carrier_down_changes_total{interface="eth0"} 1
node_network_carrier_down_changes_total{device="eth0"} 1
# HELP node_network_carrier_up_changes_total carrier_up_changes_total value of /sys/class/net/<iface>.
# TYPE node_network_carrier_up_changes_total counter
node_network_carrier_up_changes_total{interface="eth0"} 1
node_network_carrier_up_changes_total{device="eth0"} 1
# HELP node_network_device_id device_id value of /sys/class/net/<iface>.
# TYPE node_network_device_id gauge
node_network_device_id{interface="eth0"} 32
node_network_device_id{device="eth0"} 32
# HELP node_network_dormant dormant value of /sys/class/net/<iface>.
# TYPE node_network_dormant gauge
node_network_dormant{interface="eth0"} 1
node_network_dormant{device="eth0"} 1
# HELP node_network_flags flags value of /sys/class/net/<iface>.
# TYPE node_network_flags gauge
node_network_flags{interface="eth0"} 4867
node_network_flags{device="eth0"} 4867
# HELP node_network_iface_id iface_id value of /sys/class/net/<iface>.
# TYPE node_network_iface_id gauge
node_network_iface_id{interface="eth0"} 2
node_network_iface_id{device="eth0"} 2
# HELP node_network_iface_link iface_link value of /sys/class/net/<iface>.
# TYPE node_network_iface_link gauge
node_network_iface_link{interface="eth0"} 2
node_network_iface_link{device="eth0"} 2
# HELP node_network_iface_link_mode iface_link_mode value of /sys/class/net/<iface>.
# TYPE node_network_iface_link_mode gauge
node_network_iface_link_mode{interface="eth0"} 1
node_network_iface_link_mode{device="eth0"} 1
# HELP node_network_mtu_bytes mtu_bytes value of /sys/class/net/<iface>.
# TYPE node_network_mtu_bytes gauge
node_network_mtu_bytes{interface="eth0"} 1500
node_network_mtu_bytes{device="eth0"} 1500
# HELP node_network_name_assign_type name_assign_type value of /sys/class/net/<iface>.
# TYPE node_network_name_assign_type gauge
node_network_name_assign_type{interface="eth0"} 2
node_network_name_assign_type{device="eth0"} 2
# HELP node_network_net_dev_group net_dev_group value of /sys/class/net/<iface>.
# TYPE node_network_net_dev_group gauge
node_network_net_dev_group{interface="eth0"} 0
node_network_net_dev_group{device="eth0"} 0
# HELP node_network_protocol_type protocol_type value of /sys/class/net/<iface>.
# TYPE node_network_protocol_type gauge
node_network_protocol_type{interface="eth0"} 1
node_network_protocol_type{device="eth0"} 1
# HELP node_network_receive_bytes_total Network device statistic receive_bytes.
# TYPE node_network_receive_bytes_total counter
node_network_receive_bytes_total{device="docker0"} 6.4910168e+07
Expand Down Expand Up @@ -1945,7 +1945,7 @@ node_network_receive_packets_total{device="wlan0"} 1.3899359e+07
node_network_receive_packets_total{device="💩0"} 105557
# HELP node_network_speed_bytes speed_bytes value of /sys/class/net/<iface>.
# TYPE node_network_speed_bytes gauge
node_network_speed_bytes{interface="eth0"} 1.25e+08
node_network_speed_bytes{device="eth0"} 1.25e+08
# HELP node_network_transmit_bytes_total Network device statistic transmit_bytes.
# TYPE node_network_transmit_bytes_total counter
node_network_transmit_bytes_total{device="docker0"} 2.681662018e+09
Expand Down Expand Up @@ -2044,10 +2044,10 @@ node_network_transmit_packets_total{device="wlan0"} 1.17262e+07
node_network_transmit_packets_total{device="💩0"} 304261
# HELP node_network_transmit_queue_length transmit_queue_length value of /sys/class/net/<iface>.
# TYPE node_network_transmit_queue_length gauge
node_network_transmit_queue_length{interface="eth0"} 1000
# HELP node_network_up Valid operstate for interface.
node_network_transmit_queue_length{device="eth0"} 1000
# HELP node_network_up Valid operstate for device.
# TYPE node_network_up gauge
node_network_up{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",duplex="full",ifalias="",interface="eth0",operstate="up"} 1
node_network_up{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",device="eth0",duplex="full",ifalias="",operstate="up"} 1
# HELP node_nf_conntrack_entries Number of currently allocated flow entries for connection tracking.
# TYPE node_nf_conntrack_entries gauge
node_nf_conntrack_entries 123
Expand Down
6 changes: 3 additions & 3 deletions collector/netclass_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func (c *netClassCollector) Update(ch chan<- prometheus.Metric) error {
for _, ifaceInfo := range netClass {
upDesc := prometheus.NewDesc(
prometheus.BuildFQName(namespace, c.subsystem, "up"),
"Valid operstate for interface.",
[]string{"interface", "address", "broadcast", "duplex", "operstate", "ifalias"},
"Valid operstate for device.",
[]string{"device", "address", "broadcast", "duplex", "operstate", "ifalias"},
nil,
)
upValue := 0.0
Expand Down Expand Up @@ -145,7 +145,7 @@ func pushMetric(ch chan<- prometheus.Metric, subsystem string, name string, valu
fieldDesc := prometheus.NewDesc(
prometheus.BuildFQName(namespace, subsystem, name),
fmt.Sprintf("%s value of /sys/class/net/<iface>.", name),
[]string{"interface"},
[]string{"device"},
nil,
)

Expand Down

0 comments on commit 6ea0aa7

Please sign in to comment.