From 9572e7a07b46f637f8754c67f9c7bf3a0a59f6fb Mon Sep 17 00:00:00 2001 From: Sam Leiken Date: Mon, 29 Apr 2024 10:38:29 -0700 Subject: [PATCH] Add logging for ethtool device include/exclude and metrics include flags (#2979) 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 7412c27c..45c35851 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,