@@ -52,34 +52,29 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
5252 metrics : exportedMetrics {
5353 {
5454 desc : prometheus .NewDesc (
55- prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "milliseconds " ),
55+ prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "seconds_total " ),
5656 "beat.cpu.time" ,
5757 nil , prometheus.Labels {"mode" : "system" },
5858 ),
59- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .System .Time .MS },
59+ eval : func (stats * Stats ) float64 {
60+ return (time .Duration (stats .Beat .CPU .System .Time .MS ) * time .Millisecond ).Seconds ()
61+ },
6062 valType : prometheus .CounterValue ,
6163 },
6264 {
6365 desc : prometheus .NewDesc (
64- prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "milliseconds " ),
66+ prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "seconds_total " ),
6567 "beat.cpu.time" ,
6668 nil , prometheus.Labels {"mode" : "user" },
6769 ),
68- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .User .Time .MS },
69- valType : prometheus .CounterValue ,
70- },
71- {
72- desc : prometheus .NewDesc (
73- prometheus .BuildFQName (beatInfo .Beat , "cpu_time" , "milliseconds" ),
74- "beat.cpu.time" ,
75- nil , prometheus.Labels {"mode" : "total" },
76- ),
77- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .Total .Time .MS },
70+ eval : func (stats * Stats ) float64 {
71+ return (time .Duration (stats .Beat .CPU .User .Time .MS ) * time .Millisecond ).Seconds ()
72+ },
7873 valType : prometheus .CounterValue ,
7974 },
8075 {
8176 desc : prometheus .NewDesc (
82- prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks " ),
77+ prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks_total " ),
8378 "beat.cpu.ticks" ,
8479 nil , prometheus.Labels {"mode" : "system" },
8580 ),
@@ -88,7 +83,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
8883 },
8984 {
9085 desc : prometheus .NewDesc (
91- prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks " ),
86+ prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks_total " ),
9287 "beat.cpu.ticks" ,
9388 nil , prometheus.Labels {"mode" : "user" },
9489 ),
@@ -97,16 +92,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
9792 },
9893 {
9994 desc : prometheus .NewDesc (
100- prometheus .BuildFQName (beatInfo .Beat , "cpu" , "ticks" ),
101- "beat.cpu.ticks" ,
102- nil , prometheus.Labels {"mode" : "total" },
103- ),
104- eval : func (stats * Stats ) float64 { return stats .Beat .CPU .Total .Ticks },
105- valType : prometheus .CounterValue ,
106- },
107- {
108- desc : prometheus .NewDesc (
109- prometheus .BuildFQName (beatInfo .Beat , "uptime" , "seconds" ),
95+ prometheus .BuildFQName (beatInfo .Beat , "uptime" , "seconds_total" ),
11096 "beat.info.uptime.ms" ,
11197 nil , nil ,
11298 ),
@@ -117,7 +103,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
117103 },
118104 {
119105 desc : prometheus .NewDesc (
120- prometheus .BuildFQName (beatInfo .Beat , "memstats" , "gc_next " ),
106+ prometheus .BuildFQName (beatInfo .Beat , "memstats" , "gc_next_total " ),
121107 "beat.memstats.gc_next" ,
122108 nil , nil ,
123109 ),
@@ -139,7 +125,7 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector {
139125 },
140126 {
141127 desc : prometheus .NewDesc (
142- prometheus .BuildFQName (beatInfo .Beat , "memstats" , "memory_total " ),
128+ prometheus .BuildFQName (beatInfo .Beat , "memstats" , "memory " ),
143129 "beat.memstats.memory_total" ,
144130 nil , nil ,
145131 ),
0 commit comments