diff options
author | Benjamin Drung <benjamin.drung@cloud.ionos.com> | 2020-02-20 17:36:02 +0100 |
---|---|---|
committer | Johannes 'fish' Ziemke <github@freigeist.org> | 2020-03-20 17:27:11 +0100 |
commit | 34d50e15d56a5bc455687b6c535962f12505c7e1 (patch) | |
tree | 4d5a3c4cde261539090bcdefdae91edced7d0a53 /collector/cpu_linux.go | |
parent | 47610d0d2b0e8bccc0595e413f232c24bdd56260 (diff) | |
download | prometheus_node_collector-34d50e15d56a5bc455687b6c535962f12505c7e1.tar.bz2 prometheus_node_collector-34d50e15d56a5bc455687b6c535962f12505c7e1.tar.xz prometheus_node_collector-34d50e15d56a5bc455687b6c535962f12505c7e1.zip |
Add model_name and stepping to node_cpu_info metric
The `node_cpu_info` metric contains some information like the `model`
(which is an integer), but not the human readable model name. Also the
stepping of the processor might be interesting, since different stepping
of a processor might behave differently.
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
Diffstat (limited to 'collector/cpu_linux.go')
-rw-r--r-- | collector/cpu_linux.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index f5e9ce8..ae8ee53 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go | |||
@@ -57,7 +57,7 @@ func NewCPUCollector(logger log.Logger) (Collector, error) { | |||
57 | cpuInfo: prometheus.NewDesc( | 57 | cpuInfo: prometheus.NewDesc( |
58 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "info"), | 58 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "info"), |
59 | "CPU information from /proc/cpuinfo.", | 59 | "CPU information from /proc/cpuinfo.", |
60 | []string{"package", "core", "cpu", "vendor", "family", "model", "microcode", "cachesize"}, nil, | 60 | []string{"package", "core", "cpu", "vendor", "family", "model", "model_name", "microcode", "stepping", "cachesize"}, nil, |
61 | ), | 61 | ), |
62 | cpuGuest: prometheus.NewDesc( | 62 | cpuGuest: prometheus.NewDesc( |
63 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "guest_seconds_total"), | 63 | prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "guest_seconds_total"), |
@@ -110,7 +110,9 @@ func (c *cpuCollector) updateInfo(ch chan<- prometheus.Metric) error { | |||
110 | cpu.VendorID, | 110 | cpu.VendorID, |
111 | cpu.CPUFamily, | 111 | cpu.CPUFamily, |
112 | cpu.Model, | 112 | cpu.Model, |
113 | cpu.ModelName, | ||
113 | cpu.Microcode, | 114 | cpu.Microcode, |
115 | cpu.Stepping, | ||
114 | cpu.CacheSize) | 116 | cpu.CacheSize) |
115 | } | 117 | } |
116 | return nil | 118 | return nil |