switch to go-kit/log (#1575)

Signed-off-by: yeya24 <yb532204897@gmail.com>
This commit is contained in:
Ben Ye 2019-12-31 11:19:37 -05:00 committed by Ben Kochie
commit 2477c5c67d
158 changed files with 3434 additions and 4636 deletions

View file

@ -19,6 +19,7 @@ import (
"fmt"
"path/filepath"
"github.com/go-kit/kit/log"
"github.com/prometheus/client_golang/prometheus"
)
@ -29,6 +30,7 @@ var (
type ksmdCollector struct {
metricDescs map[string]*prometheus.Desc
logger log.Logger
}
func init() {
@ -47,7 +49,7 @@ func getCanonicalMetricName(filename string) string {
}
// NewKsmdCollector returns a new Collector exposing kernel/system statistics.
func NewKsmdCollector() (Collector, error) {
func NewKsmdCollector(logger log.Logger) (Collector, error) {
subsystem := "ksmd"
descs := make(map[string]*prometheus.Desc)
@ -56,7 +58,7 @@ func NewKsmdCollector() (Collector, error) {
prometheus.BuildFQName(namespace, subsystem, getCanonicalMetricName(n)),
fmt.Sprintf("ksmd '%s' file.", n), nil, nil)
}
return &ksmdCollector{descs}, nil
return &ksmdCollector{descs, logger}, nil
}
// Update implements Collector and exposes kernel and system statistics.