Skip to content

Commit 3b5276d

Browse files
authored
Merge pull request #2044 from mfranczy/network-mtu
Discover MTU of physical and virtual network devices
2 parents a914955 + 69f5009 commit 3b5276d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/usage/customization-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,10 +974,10 @@ The following features are available for matching:
974974
| | | **`hugepages-<page-size>`** | string | Total number of huge pages (e.g., `hugepages-1Gi=16`) |
975975
| **`network.device`** | instance | | | Physical (non-virtual) network interfaces present in the system |
976976
| | | **`name`** | string | Name of the network interface |
977-
| | | **`<sysfs-attribute>`** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed`, `sriov_numvfs`, `sriov_totalvfs` |
977+
| | | **`<sysfs-attribute>`** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed`, `sriov_numvfs`, `sriov_totalvfs`, `mtu` |
978978
| **`network.virtual`** | instance | | | Virtual network interfaces present in the system |
979979
| | | **`name`** | string | Name of the network interface |
980-
| | | **`<sysfs-attribute>`** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed` |
980+
| | | **`<sysfs-attribute>`** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed`, `mtu` |
981981
| **`pci.device`** | instance | | | PCI devices present in the system |
982982
| | | **`<sysfs-attribute>`** | string | Value of the sysfs device attribute, available attributes: `class`, `vendor`, `device`, `subsystem_vendor`, `subsystem_device`, `sriov_totalvfs`, `iommu_group/type`, `iommu/intel-iommu/version` |
983983
| **`storage.block`** | instance | | | Block storage devices present in the system |

source/network/network.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ var (
6060

6161
var (
6262
// devIfaceAttrs is the list of files under /sys/class/net/<iface> that we're reading
63-
devIfaceAttrs = []string{"operstate", "speed", "device/sriov_numvfs", "device/sriov_totalvfs"}
63+
devIfaceAttrs = []string{"operstate", "speed", "device/sriov_numvfs", "device/sriov_totalvfs", "mtu"}
6464

6565
// virtualIfaceAttrs is the list of files under /sys/class/net/<iface> that we're reading
66-
virtualIfaceAttrs = []string{"operstate", "speed"}
66+
virtualIfaceAttrs = []string{"operstate", "speed", "mtu"}
6767
)
6868

6969
// Name returns an identifier string for this feature source.

0 commit comments

Comments
 (0)