From f316099f87b0fc8e0fda0d56c1b6e8adcc51e1a8 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Tue, 31 Dec 2019 19:36:39 +0100 Subject: [PATCH] Fix up softnet collector for go-kit change (#1581) Add missing update for new go-kit logging change. Signed-off-by: Ben Kochie --- collector/softnet_linux.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/collector/softnet_linux.go b/collector/softnet_linux.go index 3e767cab..1f0bdec0 100644 --- a/collector/softnet_linux.go +++ b/collector/softnet_linux.go @@ -19,6 +19,7 @@ import ( "fmt" "strconv" + "github.com/go-kit/kit/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs" ) @@ -28,6 +29,7 @@ type softnetCollector struct { processed *prometheus.Desc dropped *prometheus.Desc timeSqueezed *prometheus.Desc + logger log.Logger } const ( @@ -39,7 +41,7 @@ func init() { } // NewSoftnetCollector returns a new Collector exposing softnet metrics. -func NewSoftnetCollector() (Collector, error) { +func NewSoftnetCollector(logger log.Logger) (Collector, error) { fs, err := procfs.NewFS(*procPath) if err != nil { return nil, fmt.Errorf("failed to open procfs: %w", err) @@ -62,6 +64,7 @@ func NewSoftnetCollector() (Collector, error) { "Number of times processing packets ran out of quota", []string{"cpu"}, nil, ), + logger: logger, }, nil }