Skip to content

Commit

Permalink
Fix up softnet collector for go-kit change (#1581)
Browse files Browse the repository at this point in the history
Add missing update for new go-kit logging change.

Signed-off-by: Ben Kochie <superq@gmail.com>
  • Loading branch information
SuperQ authored Dec 31, 2019
1 parent 2477c5c commit f316099
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion collector/softnet_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"strconv"

"github.com/go-kit/kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)
Expand All @@ -28,6 +29,7 @@ type softnetCollector struct {
processed *prometheus.Desc
dropped *prometheus.Desc
timeSqueezed *prometheus.Desc
logger log.Logger
}

const (
Expand All @@ -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)
Expand All @@ -62,6 +64,7 @@ func NewSoftnetCollector() (Collector, error) {
"Number of times processing packets ran out of quota",
[]string{"cpu"}, nil,
),
logger: logger,
}, nil
}

Expand Down

0 comments on commit f316099

Please sign in to comment.