diff options
author | Johannes 'fish' Ziemke <github@freigeist.org> | 2019-02-06 20:02:48 +0100 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-02-06 20:02:48 +0100 |
commit | 6ea0aa73e4ab40259d843b41adeea43b1a78379b (patch) | |
tree | b5708be09a6a1843826a3240df03cdebcbe791dc | |
parent | 3867ad5ab00846010238bc10ab6aec04169fd7f5 (diff) | |
download | prometheus_node_collector-6ea0aa73e4ab40259d843b41adeea43b1a78379b.tar.bz2 prometheus_node_collector-6ea0aa73e4ab40259d843b41adeea43b1a78379b.tar.xz prometheus_node_collector-6ea0aa73e4ab40259d843b41adeea43b1a78379b.zip |
Rename interface to device in netclass collector (#1224)
* Rename interface to device in netclass collector
This makes it consistent with other networking metrics like node_network_receive_bytes_total
This closes #1223
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | collector/fixtures/e2e-output.txt | 38 | ||||
-rw-r--r-- | collector/netclass_linux.go | 6 |
3 files changed, 26 insertions, 23 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b3c464d..7d95bc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -2,11 +2,14 @@ | |||
2 | 2 | ||
3 | ### **Breaking changes** | 3 | ### **Breaking changes** |
4 | 4 | ||
5 | The cpufreq metrics now separate the `cpufreq` and `scaling` data based on what the driver provides. #1248 | 5 | * Renamed `interface` label to `device` in netclass collector for consistency with |
6 | other network metrics #1224 | ||
7 | * The cpufreq metrics now separate the `cpufreq` and `scaling` data based on what the driver provides. #1248 | ||
6 | 8 | ||
7 | ### Changes | 9 | ### Changes |
8 | 10 | ||
9 | * [BUGFIX] | 11 | * [BUGFIX] |
12 | * [CHANGE] Renamed `interface` label to `device` in netclass collector #1224 | ||
10 | * [BUGFIX] Add fallback for missing /proc/1/mounts #1172 | 13 | * [BUGFIX] Add fallback for missing /proc/1/mounts #1172 |
11 | * [CHANGE] Add TCPSynRetrans to netstat default filter #1143 | 14 | * [CHANGE] Add TCPSynRetrans to netstat default filter #1143 |
12 | * [CHANGE] Add a limit to the number of in-flight requests #1166 | 15 | * [CHANGE] Add a limit to the number of in-flight requests #1166 |
diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index ba11e23..2f9e097 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt | |||
@@ -1804,49 +1804,49 @@ node_netstat_Udp_NoPorts 120 | |||
1804 | node_netstat_Udp_OutDatagrams 53028 | 1804 | node_netstat_Udp_OutDatagrams 53028 |
1805 | # HELP node_network_address_assign_type address_assign_type value of /sys/class/net/<iface>. | 1805 | # HELP node_network_address_assign_type address_assign_type value of /sys/class/net/<iface>. |
1806 | # TYPE node_network_address_assign_type gauge | 1806 | # TYPE node_network_address_assign_type gauge |
1807 | node_network_address_assign_type{interface="eth0"} 3 | 1807 | node_network_address_assign_type{device="eth0"} 3 |
1808 | # HELP node_network_carrier carrier value of /sys/class/net/<iface>. | 1808 | # HELP node_network_carrier carrier value of /sys/class/net/<iface>. |
1809 | # TYPE node_network_carrier gauge | 1809 | # TYPE node_network_carrier gauge |
1810 | node_network_carrier{interface="eth0"} 1 | 1810 | node_network_carrier{device="eth0"} 1 |
1811 | # HELP node_network_carrier_changes_total carrier_changes_total value of /sys/class/net/<iface>. | 1811 | # HELP node_network_carrier_changes_total carrier_changes_total value of /sys/class/net/<iface>. |
1812 | # TYPE node_network_carrier_changes_total counter | 1812 | # TYPE node_network_carrier_changes_total counter |
1813 | node_network_carrier_changes_total{interface="eth0"} 2 | 1813 | node_network_carrier_changes_total{device="eth0"} 2 |
1814 | # HELP node_network_carrier_down_changes_total carrier_down_changes_total value of /sys/class/net/<iface>. | 1814 | # HELP node_network_carrier_down_changes_total carrier_down_changes_total value of /sys/class/net/<iface>. |
1815 | # TYPE node_network_carrier_down_changes_total counter | 1815 | # TYPE node_network_carrier_down_changes_total counter |
1816 | node_network_carrier_down_changes_total{interface="eth0"} 1 | 1816 | node_network_carrier_down_changes_total{device="eth0"} 1 |
1817 | # HELP node_network_carrier_up_changes_total carrier_up_changes_total value of /sys/class/net/<iface>. | 1817 | # HELP node_network_carrier_up_changes_total carrier_up_changes_total value of /sys/class/net/<iface>. |
1818 | # TYPE node_network_carrier_up_changes_total counter | 1818 | # TYPE node_network_carrier_up_changes_total counter |
1819 | node_network_carrier_up_changes_total{interface="eth0"} 1 | 1819 | node_network_carrier_up_changes_total{device="eth0"} 1 |
1820 | # HELP node_network_device_id device_id value of /sys/class/net/<iface>. | 1820 | # HELP node_network_device_id device_id value of /sys/class/net/<iface>. |
1821 | # TYPE node_network_device_id gauge | 1821 | # TYPE node_network_device_id gauge |
1822 | node_network_device_id{interface="eth0"} 32 | 1822 | node_network_device_id{device="eth0"} 32 |
1823 | # HELP node_network_dormant dormant value of /sys/class/net/<iface>. | 1823 | # HELP node_network_dormant dormant value of /sys/class/net/<iface>. |
1824 | # TYPE node_network_dormant gauge | 1824 | # TYPE node_network_dormant gauge |
1825 | node_network_dormant{interface="eth0"} 1 | 1825 | node_network_dormant{device="eth0"} 1 |
1826 | # HELP node_network_flags flags value of /sys/class/net/<iface>. | 1826 | # HELP node_network_flags flags value of /sys/class/net/<iface>. |
1827 | # TYPE node_network_flags gauge | 1827 | # TYPE node_network_flags gauge |
1828 | node_network_flags{interface="eth0"} 4867 | 1828 | node_network_flags{device="eth0"} 4867 |
1829 | # HELP node_network_iface_id iface_id value of /sys/class/net/<iface>. | 1829 | # HELP node_network_iface_id iface_id value of /sys/class/net/<iface>. |
1830 | # TYPE node_network_iface_id gauge | 1830 | # TYPE node_network_iface_id gauge |
1831 | node_network_iface_id{interface="eth0"} 2 | 1831 | node_network_iface_id{device="eth0"} 2 |
1832 | # HELP node_network_iface_link iface_link value of /sys/class/net/<iface>. | 1832 | # HELP node_network_iface_link iface_link value of /sys/class/net/<iface>. |
1833 | # TYPE node_network_iface_link gauge | 1833 | # TYPE node_network_iface_link gauge |
1834 | node_network_iface_link{interface="eth0"} 2 | 1834 | node_network_iface_link{device="eth0"} 2 |
1835 | # HELP node_network_iface_link_mode iface_link_mode value of /sys/class/net/<iface>. | 1835 | # HELP node_network_iface_link_mode iface_link_mode value of /sys/class/net/<iface>. |
1836 | # TYPE node_network_iface_link_mode gauge | 1836 | # TYPE node_network_iface_link_mode gauge |
1837 | node_network_iface_link_mode{interface="eth0"} 1 | 1837 | node_network_iface_link_mode{device="eth0"} 1 |
1838 | # HELP node_network_mtu_bytes mtu_bytes value of /sys/class/net/<iface>. | 1838 | # HELP node_network_mtu_bytes mtu_bytes value of /sys/class/net/<iface>. |
1839 | # TYPE node_network_mtu_bytes gauge | 1839 | # TYPE node_network_mtu_bytes gauge |
1840 | node_network_mtu_bytes{interface="eth0"} 1500 | 1840 | node_network_mtu_bytes{device="eth0"} 1500 |
1841 | # HELP node_network_name_assign_type name_assign_type value of /sys/class/net/<iface>. | 1841 | # HELP node_network_name_assign_type name_assign_type value of /sys/class/net/<iface>. |
1842 | # TYPE node_network_name_assign_type gauge | 1842 | # TYPE node_network_name_assign_type gauge |
1843 | node_network_name_assign_type{interface="eth0"} 2 | 1843 | node_network_name_assign_type{device="eth0"} 2 |
1844 | # HELP node_network_net_dev_group net_dev_group value of /sys/class/net/<iface>. | 1844 | # HELP node_network_net_dev_group net_dev_group value of /sys/class/net/<iface>. |
1845 | # TYPE node_network_net_dev_group gauge | 1845 | # TYPE node_network_net_dev_group gauge |
1846 | node_network_net_dev_group{interface="eth0"} 0 | 1846 | node_network_net_dev_group{device="eth0"} 0 |
1847 | # HELP node_network_protocol_type protocol_type value of /sys/class/net/<iface>. | 1847 | # HELP node_network_protocol_type protocol_type value of /sys/class/net/<iface>. |
1848 | # TYPE node_network_protocol_type gauge | 1848 | # TYPE node_network_protocol_type gauge |
1849 | node_network_protocol_type{interface="eth0"} 1 | 1849 | node_network_protocol_type{device="eth0"} 1 |
1850 | # HELP node_network_receive_bytes_total Network device statistic receive_bytes. | 1850 | # HELP node_network_receive_bytes_total Network device statistic receive_bytes. |
1851 | # TYPE node_network_receive_bytes_total counter | 1851 | # TYPE node_network_receive_bytes_total counter |
1852 | node_network_receive_bytes_total{device="docker0"} 6.4910168e+07 | 1852 | node_network_receive_bytes_total{device="docker0"} 6.4910168e+07 |
@@ -1945,7 +1945,7 @@ node_network_receive_packets_total{device="wlan0"} 1.3899359e+07 | |||
1945 | node_network_receive_packets_total{device="💩0"} 105557 | 1945 | node_network_receive_packets_total{device="💩0"} 105557 |
1946 | # HELP node_network_speed_bytes speed_bytes value of /sys/class/net/<iface>. | 1946 | # HELP node_network_speed_bytes speed_bytes value of /sys/class/net/<iface>. |
1947 | # TYPE node_network_speed_bytes gauge | 1947 | # TYPE node_network_speed_bytes gauge |
1948 | node_network_speed_bytes{interface="eth0"} 1.25e+08 | 1948 | node_network_speed_bytes{device="eth0"} 1.25e+08 |
1949 | # HELP node_network_transmit_bytes_total Network device statistic transmit_bytes. | 1949 | # HELP node_network_transmit_bytes_total Network device statistic transmit_bytes. |
1950 | # TYPE node_network_transmit_bytes_total counter | 1950 | # TYPE node_network_transmit_bytes_total counter |
1951 | node_network_transmit_bytes_total{device="docker0"} 2.681662018e+09 | 1951 | node_network_transmit_bytes_total{device="docker0"} 2.681662018e+09 |
@@ -2044,10 +2044,10 @@ node_network_transmit_packets_total{device="wlan0"} 1.17262e+07 | |||
2044 | node_network_transmit_packets_total{device="💩0"} 304261 | 2044 | node_network_transmit_packets_total{device="💩0"} 304261 |
2045 | # HELP node_network_transmit_queue_length transmit_queue_length value of /sys/class/net/<iface>. | 2045 | # HELP node_network_transmit_queue_length transmit_queue_length value of /sys/class/net/<iface>. |
2046 | # TYPE node_network_transmit_queue_length gauge | 2046 | # TYPE node_network_transmit_queue_length gauge |
2047 | node_network_transmit_queue_length{interface="eth0"} 1000 | 2047 | node_network_transmit_queue_length{device="eth0"} 1000 |
2048 | # HELP node_network_up Valid operstate for interface. | 2048 | # HELP node_network_up Valid operstate for device. |
2049 | # TYPE node_network_up gauge | 2049 | # TYPE node_network_up gauge |
2050 | 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 | 2050 | 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 |
2051 | # HELP node_nf_conntrack_entries Number of currently allocated flow entries for connection tracking. | 2051 | # HELP node_nf_conntrack_entries Number of currently allocated flow entries for connection tracking. |
2052 | # TYPE node_nf_conntrack_entries gauge | 2052 | # TYPE node_nf_conntrack_entries gauge |
2053 | node_nf_conntrack_entries 123 | 2053 | node_nf_conntrack_entries 123 |
diff --git a/collector/netclass_linux.go b/collector/netclass_linux.go index a71f302..fffbd84 100644 --- a/collector/netclass_linux.go +++ b/collector/netclass_linux.go | |||
@@ -57,8 +57,8 @@ func (c *netClassCollector) Update(ch chan<- prometheus.Metric) error { | |||
57 | for _, ifaceInfo := range netClass { | 57 | for _, ifaceInfo := range netClass { |
58 | upDesc := prometheus.NewDesc( | 58 | upDesc := prometheus.NewDesc( |
59 | prometheus.BuildFQName(namespace, c.subsystem, "up"), | 59 | prometheus.BuildFQName(namespace, c.subsystem, "up"), |
60 | "Valid operstate for interface.", | 60 | "Valid operstate for device.", |
61 | []string{"interface", "address", "broadcast", "duplex", "operstate", "ifalias"}, | 61 | []string{"device", "address", "broadcast", "duplex", "operstate", "ifalias"}, |
62 | nil, | 62 | nil, |
63 | ) | 63 | ) |
64 | upValue := 0.0 | 64 | upValue := 0.0 |
@@ -145,7 +145,7 @@ func pushMetric(ch chan<- prometheus.Metric, subsystem string, name string, valu | |||
145 | fieldDesc := prometheus.NewDesc( | 145 | fieldDesc := prometheus.NewDesc( |
146 | prometheus.BuildFQName(namespace, subsystem, name), | 146 | prometheus.BuildFQName(namespace, subsystem, name), |
147 | fmt.Sprintf("%s value of /sys/class/net/<iface>.", name), | 147 | fmt.Sprintf("%s value of /sys/class/net/<iface>.", name), |
148 | []string{"interface"}, | 148 | []string{"device"}, |
149 | nil, | 149 | nil, |
150 | ) | 150 | ) |
151 | 151 | ||