Commit graph

5 commits

Author SHA1 Message Date
Daniel Liu
9eae1243cd metrics: add cpu counters (#26796)
This PR adds counter metrics for the CPU system and the Geth process.
Currently the only metrics available for these items are gauges. Gauges are
fine when the consumer scrapes metrics data at the same interval as Geth
produces new values (every 3 seconds), but it is likely that most consumers
will not scrape that often. Intervals of 10, 15, or maybe even 30 seconds
are probably more common.

So the problem is, how does the consumer estimate what the CPU was doing in
between scrapes. With a counter, it's easy ... you just subtract two
successive values and divide by the time to get a nice, accurate average.
But with a gauge, you can't do that. A gauge reading is an instantaneous
picture of what was happening at that moment, but it gives you no idea
about what was going on between scrapes. Taking an average of values is
meaningless.
2024-12-13 14:00:13 +08:00
Daniel Liu
e8452c94a7 metrics: fix some typos (#25551) 2024-12-13 14:00:12 +08:00
Daniel Liu
d77c1e5ea3 metrics: replace strings.Replace with string.ReplaceAll (#24835) 2024-12-13 14:00:12 +08:00
Daniel Liu
32f974cc7b metrics/prometheus: define TYPE once, add tests (#21068)
* metrics/prometheus: define type once for histograms

* metrics/prometheus: test collector
2024-12-13 14:00:12 +08:00
Daniel Liu
a577c71944 metrics/prometheus: added prometheus metrics (#17077) 2024-12-13 14:00:11 +08:00