Skip to content

Commit 3895ba2

Browse files
authored
Exclude loopback interface from ethtool (DataDog#13042)
* Exclude loopback interfaces lo and lo0 from SIOCETHTOOL Loopback interfaces doesn't support this ioctl call and they are not gonna expose driver specific informations. Exclude them so that we don't generate error logs. * Update configuration example to mention lo exclusion for ethtool
1 parent a9d2378 commit 3895ba2

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

network/assets/configuration/spec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ files:
148148
The queue and cpu will be used as a tag when submitting metrics.
149149
For example, 'queue_0_tx_cnt' will be submitted as 'system.net.ena.queue.tx_cnt' with tag 'queue:0'
150150
151+
Loopback interfaces 'lo' and 'lo0' are excluded as they don't support SIOCETHTOOL.
152+
151153
Currently supported drivers:
152154
- ena
153155
- virtio_net

network/datadog_checks/network/data/conf.yaml.default

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ instances:
126126
## The queue and cpu will be used as a tag when submitting metrics.
127127
## For example, 'queue_0_tx_cnt' will be submitted as 'system.net.ena.queue.tx_cnt' with tag 'queue:0'
128128
##
129+
## Loopback interfaces 'lo' and 'lo0' are excluded as they don't support SIOCETHTOOL.
130+
##
129131
## Currently supported drivers:
130132
## - ena
131133
## - virtio_net

network/datadog_checks/network/network.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,10 @@ def _handle_ethtool_stats(self, iface, custom_tags):
10641064
if iface in self._excluded_ifaces or (self._exclude_iface_re and self._exclude_iface_re.match(iface)):
10651065
# Skip this network interface.
10661066
return
1067+
if iface in ['lo', 'lo0']:
1068+
# Skip loopback ifaces as they don't support SIOCETHTOOL
1069+
return
1070+
10671071
driver_name, driver_version, ethtool_stats_names, ethtool_stats = self._fetch_ethtool_stats(iface)
10681072
tags = [] if custom_tags is None else custom_tags[:]
10691073
tags.append('driver_name:{}'.format(driver_name))

0 commit comments

Comments
 (0)