diff options
author | Ben Ye <yb532204897@gmail.com> | 2019-12-31 11:19:37 -0500 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-12-31 17:19:37 +0100 |
commit | 2477c5c67dff7e7655a9d466450235e9c9eac193 (patch) | |
tree | 198cb44d48f454df765984bc614e1b1972a646e8 /collector/cpu_solaris.go | |
parent | a80b7d0bc5ee93e704bab22e7592ed8b7d65899e (diff) | |
download | prometheus_node_collector-2477c5c67dff7e7655a9d466450235e9c9eac193.tar.bz2 prometheus_node_collector-2477c5c67dff7e7655a9d466450235e9c9eac193.tar.xz prometheus_node_collector-2477c5c67dff7e7655a9d466450235e9c9eac193.zip |
switch to go-kit/log (#1575)
Signed-off-by: yeya24 <yb532204897@gmail.com>
Diffstat (limited to 'collector/cpu_solaris.go')
-rw-r--r-- | collector/cpu_solaris.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/collector/cpu_solaris.go b/collector/cpu_solaris.go index f772765..0624454 100644 --- a/collector/cpu_solaris.go +++ b/collector/cpu_solaris.go | |||
@@ -19,6 +19,7 @@ package collector | |||
19 | import ( | 19 | import ( |
20 | "strconv" | 20 | "strconv" |
21 | 21 | ||
22 | "github.com/go-kit/kit/log" | ||
22 | "github.com/prometheus/client_golang/prometheus" | 23 | "github.com/prometheus/client_golang/prometheus" |
23 | kstat "github.com/siebenmann/go-kstat" | 24 | kstat "github.com/siebenmann/go-kstat" |
24 | ) | 25 | ) |
@@ -27,16 +28,18 @@ import ( | |||
27 | import "C" | 28 | import "C" |
28 | 29 | ||
29 | type cpuCollector struct { | 30 | type cpuCollector struct { |
30 | cpu typedDesc | 31 | cpu typedDesc |
32 | logger log.Logger | ||
31 | } | 33 | } |
32 | 34 | ||
33 | func init() { | 35 | func init() { |
34 | registerCollector("cpu", defaultEnabled, NewCpuCollector) | 36 | registerCollector("cpu", defaultEnabled, NewCpuCollector) |
35 | } | 37 | } |
36 | 38 | ||
37 | func NewCpuCollector() (Collector, error) { | 39 | func NewCpuCollector(logger log.Logger) (Collector, error) { |
38 | return &cpuCollector{ | 40 | return &cpuCollector{ |
39 | cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue}, | 41 | cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue}, |
42 | logger: logger, | ||
40 | }, nil | 43 | }, nil |
41 | } | 44 | } |
42 | 45 | ||