diff --git a/collector/ethtool_linux.go b/collector/ethtool_linux.go index c68b3e9f..04a7260d 100644 --- a/collector/ethtool_linux.go +++ b/collector/ethtool_linux.go @@ -27,6 +27,7 @@ import ( "regexp" "sort" "strings" + "sync" "syscall" "github.com/go-kit/log" @@ -73,6 +74,7 @@ func (e *ethtoolLibrary) LinkInfo(intf string) (ethtool.EthtoolCmd, error) { type ethtoolCollector struct { fs sysfs.FS entries map[string]*prometheus.Desc + entriesMutex sync.Mutex ethtool Ethtool deviceFilter netDevFilter infoDesc *prometheus.Desc @@ -233,9 +235,9 @@ func (c *ethtoolCollector) updatePortCapabilities(ch chan<- prometheus.Metric, p if linkModes&(1<