From 2aae378267ee0fb20c12ede014dfc5c8625f8ae9 Mon Sep 17 00:00:00 2001 From: Sam Leiken Date: Fri, 29 Mar 2024 15:31:19 -0700 Subject: [PATCH] Add logging for ethtool device include/exclude and metrics include flags Signed-off-by: Sam Leiken --- collector/ethtool_linux.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/collector/ethtool_linux.go b/collector/ethtool_linux.go index 7412c27c37..45c35851d6 100644 --- a/collector/ethtool_linux.go +++ b/collector/ethtool_linux.go @@ -96,6 +96,16 @@ func makeEthtoolCollector(logger log.Logger) (*ethtoolCollector, error) { return nil, fmt.Errorf("failed to initialize ethtool library: %w", err) } + if *ethtoolDeviceInclude != "" { + level.Info(logger).Log("msg", "Parsed flag --collector.ethtool.device-include", "flag", *ethtoolDeviceInclude) + } + if *ethtoolDeviceExclude != "" { + level.Info(logger).Log("msg", "Parsed flag --collector.ethtool.device-exclude", "flag", *ethtoolDeviceExclude) + } + if *ethtoolIncludedMetrics != "" { + level.Info(logger).Log("msg", "Parsed flag --collector.ethtool.metrics-include", "flag", *ethtoolIncludedMetrics) + } + // Pre-populate some common ethtool metrics. return ðtoolCollector{ fs: fs,