Skip to content

Commit aa3bce3

Browse files
authored
Merge pull request #2332 from prometheus/superq/bump_mods
Update Go modues
2 parents 9aae303 + 9155971 commit aa3bce3

File tree

4 files changed

+158
-96
lines changed

4 files changed

+158
-96
lines changed

collector/fixtures/e2e-output.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,63 @@
1+
# HELP go_gc_cycles_automatic_gc_cycles_total Count of completed GC cycles generated by the Go runtime.
2+
# TYPE go_gc_cycles_automatic_gc_cycles_total counter
3+
# HELP go_gc_cycles_forced_gc_cycles_total Count of completed GC cycles forced by the application.
4+
# TYPE go_gc_cycles_forced_gc_cycles_total counter
5+
# HELP go_gc_cycles_total_gc_cycles_total Count of all completed GC cycles.
6+
# TYPE go_gc_cycles_total_gc_cycles_total counter
17
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
28
# TYPE go_gc_duration_seconds summary
9+
# HELP go_gc_heap_allocs_by_size_bytes_total Distribution of heap allocations by approximate size. Note that this does not include tiny objects as defined by /gc/heap/tiny/allocs:objects, only tiny blocks.
10+
# TYPE go_gc_heap_allocs_by_size_bytes_total histogram
11+
# HELP go_gc_heap_allocs_bytes_total Cumulative sum of memory allocated to the heap by the application.
12+
# TYPE go_gc_heap_allocs_bytes_total counter
13+
# HELP go_gc_heap_allocs_objects_total Cumulative count of heap allocations triggered by the application. Note that this does not include tiny objects as defined by /gc/heap/tiny/allocs:objects, only tiny blocks.
14+
# TYPE go_gc_heap_allocs_objects_total counter
15+
# HELP go_gc_heap_frees_by_size_bytes_total Distribution of freed heap allocations by approximate size. Note that this does not include tiny objects as defined by /gc/heap/tiny/allocs:objects, only tiny blocks.
16+
# TYPE go_gc_heap_frees_by_size_bytes_total histogram
17+
# HELP go_gc_heap_frees_bytes_total Cumulative sum of heap memory freed by the garbage collector.
18+
# TYPE go_gc_heap_frees_bytes_total counter
19+
# HELP go_gc_heap_frees_objects_total Cumulative count of heap allocations whose storage was freed by the garbage collector. Note that this does not include tiny objects as defined by /gc/heap/tiny/allocs:objects, only tiny blocks.
20+
# TYPE go_gc_heap_frees_objects_total counter
21+
# HELP go_gc_heap_goal_bytes Heap size target for the end of the GC cycle.
22+
# TYPE go_gc_heap_goal_bytes gauge
23+
# HELP go_gc_heap_objects_objects Number of objects, live or unswept, occupying heap memory.
24+
# TYPE go_gc_heap_objects_objects gauge
25+
# HELP go_gc_heap_tiny_allocs_objects_total Count of small allocations that are packed together into blocks. These allocations are counted separately from other allocations because each individual allocation is not tracked by the runtime, only their block. Each block is already accounted for in allocs-by-size and frees-by-size.
26+
# TYPE go_gc_heap_tiny_allocs_objects_total counter
27+
# HELP go_gc_pauses_seconds_total Distribution individual GC-related stop-the-world pause latencies.
28+
# TYPE go_gc_pauses_seconds_total histogram
329
# HELP go_goroutines Number of goroutines that currently exist.
430
# TYPE go_goroutines gauge
531
# HELP go_info Information about the Go environment.
632
# TYPE go_info gauge
33+
# HELP go_memory_classes_heap_free_bytes Memory that is completely free and eligible to be returned to the underlying system, but has not been. This metric is the runtime's estimate of free address space that is backed by physical memory.
34+
# TYPE go_memory_classes_heap_free_bytes gauge
35+
# HELP go_memory_classes_heap_objects_bytes Memory occupied by live objects and dead objects that have not yet been marked free by the garbage collector.
36+
# TYPE go_memory_classes_heap_objects_bytes gauge
37+
# HELP go_memory_classes_heap_released_bytes Memory that is completely free and has been returned to the underlying system. This metric is the runtime's estimate of free address space that is still mapped into the process, but is not backed by physical memory.
38+
# TYPE go_memory_classes_heap_released_bytes gauge
39+
# HELP go_memory_classes_heap_stacks_bytes Memory allocated from the heap that is reserved for stack space, whether or not it is currently in-use.
40+
# TYPE go_memory_classes_heap_stacks_bytes gauge
41+
# HELP go_memory_classes_heap_unused_bytes Memory that is reserved for heap objects but is not currently used to hold heap objects.
42+
# TYPE go_memory_classes_heap_unused_bytes gauge
43+
# HELP go_memory_classes_metadata_mcache_free_bytes Memory that is reserved for runtime mcache structures, but not in-use.
44+
# TYPE go_memory_classes_metadata_mcache_free_bytes gauge
45+
# HELP go_memory_classes_metadata_mcache_inuse_bytes Memory that is occupied by runtime mcache structures that are currently being used.
46+
# TYPE go_memory_classes_metadata_mcache_inuse_bytes gauge
47+
# HELP go_memory_classes_metadata_mspan_free_bytes Memory that is reserved for runtime mspan structures, but not in-use.
48+
# TYPE go_memory_classes_metadata_mspan_free_bytes gauge
49+
# HELP go_memory_classes_metadata_mspan_inuse_bytes Memory that is occupied by runtime mspan structures that are currently being used.
50+
# TYPE go_memory_classes_metadata_mspan_inuse_bytes gauge
51+
# HELP go_memory_classes_metadata_other_bytes Memory that is reserved for or used to hold runtime metadata.
52+
# TYPE go_memory_classes_metadata_other_bytes gauge
53+
# HELP go_memory_classes_os_stacks_bytes Stack memory allocated by the underlying operating system.
54+
# TYPE go_memory_classes_os_stacks_bytes gauge
55+
# HELP go_memory_classes_other_bytes Memory used by execution trace buffers, structures for debugging the runtime, finalizer and profiler specials, and more.
56+
# TYPE go_memory_classes_other_bytes gauge
57+
# HELP go_memory_classes_profiling_buckets_bytes Memory that is used by the stack trace hash map used for profiling.
58+
# TYPE go_memory_classes_profiling_buckets_bytes gauge
59+
# HELP go_memory_classes_total_bytes All memory mapped by the Go runtime into the current process as read-write. Note that this does not include memory mapped by code called via cgo or via the syscall package. Sum of all metrics in /memory/classes.
60+
# TYPE go_memory_classes_total_bytes gauge
761
# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
862
# TYPE go_memstats_alloc_bytes gauge
963
# HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
@@ -52,6 +106,10 @@
52106
# TYPE go_memstats_stack_sys_bytes gauge
53107
# HELP go_memstats_sys_bytes Number of bytes obtained from system.
54108
# TYPE go_memstats_sys_bytes gauge
109+
# HELP go_sched_goroutines_goroutines Count of live goroutines.
110+
# TYPE go_sched_goroutines_goroutines gauge
111+
# HELP go_sched_latencies_seconds Distribution of the time goroutines have spent in the scheduler in a runnable state before actually running.
112+
# TYPE go_sched_latencies_seconds histogram
55113
# HELP go_threads Number of OS threads created.
56114
# TYPE go_threads gauge
57115
# HELP node_arp_entries ARP entries by device

collector/perf_linux.go

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ func (c *perfTracepointCollector) update(ch chan<- prometheus.Metric) error {
161161
// updateCPU is used to update metrics per CPU profiler.
162162
func (c *perfTracepointCollector) updateCPU(cpu int, ch chan<- prometheus.Metric) error {
163163
profiler := c.profilers[cpu]
164-
p, err := profiler.Profile()
165-
if err != nil {
164+
p := &perf.GroupProfileValue{}
165+
if err := profiler.Profile(p); err != nil {
166166
level.Error(c.logger).Log("msg", "Failed to collect tracepoint profile", "err", err)
167167
return err
168168
}
@@ -286,8 +286,12 @@ func NewPerfCollector(logger log.Logger) (Collector, error) {
286286
for _, cpu := range cpus {
287287
// Use -1 to profile all processes on the CPU, see:
288288
// man perf_event_open
289-
hwProf, err := perf.NewHardwareProfiler(-1, cpu)
290-
if err != nil {
289+
hwProf, err := perf.NewHardwareProfiler(
290+
-1,
291+
cpu,
292+
perf.AllHardwareProfilers,
293+
)
294+
if err != nil && !hwProf.HasProfilers() {
291295
return nil, err
292296
}
293297
if err := hwProf.Start(); err != nil {
@@ -296,8 +300,8 @@ func NewPerfCollector(logger log.Logger) (Collector, error) {
296300
collector.perfHwProfilers[cpu] = &hwProf
297301
collector.hwProfilerCPUMap[&hwProf] = cpu
298302

299-
swProf, err := perf.NewSoftwareProfiler(-1, cpu)
300-
if err != nil {
303+
swProf, err := perf.NewSoftwareProfiler(-1, cpu, perf.AllSoftwareProfilers)
304+
if err != nil && !swProf.HasProfilers() {
301305
return nil, err
302306
}
303307
if err := swProf.Start(); err != nil {
@@ -306,8 +310,13 @@ func NewPerfCollector(logger log.Logger) (Collector, error) {
306310
collector.perfSwProfilers[cpu] = &swProf
307311
collector.swProfilerCPUMap[&swProf] = cpu
308312

309-
cacheProf, err := perf.NewCacheProfiler(-1, cpu)
310-
if err != nil {
313+
cacheProfilers := perf.L1DataReadHitProfiler & perf.L1DataReadMissProfiler & perf.L1DataWriteHitProfiler & perf.L1InstrReadMissProfiler & perf.InstrTLBReadHitProfiler & perf.InstrTLBReadMissProfiler & perf.LLReadHitProfiler & perf.LLReadMissProfiler & perf.LLWriteHitProfiler & perf.LLWriteMissProfiler & perf.BPUReadHitProfiler & perf.BPUReadMissProfiler
314+
cacheProf, err := perf.NewCacheProfiler(
315+
-1,
316+
cpu,
317+
cacheProfilers,
318+
)
319+
if err != nil && !cacheProf.HasProfilers() {
311320
return nil, err
312321
}
313322
if err := cacheProf.Start(); err != nil {
@@ -585,8 +594,8 @@ func (c *perfCollector) Update(ch chan<- prometheus.Metric) error {
585594

586595
func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error {
587596
for _, profiler := range c.perfHwProfilers {
588-
hwProfile, err := (*profiler).Profile()
589-
if err != nil {
597+
hwProfile := &perf.HardwareProfile{}
598+
if err := (*profiler).Profile(hwProfile); err != nil {
590599
return err
591600
}
592601
if hwProfile == nil {
@@ -657,8 +666,8 @@ func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error {
657666

658667
func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error {
659668
for _, profiler := range c.perfSwProfilers {
660-
swProfile, err := (*profiler).Profile()
661-
if err != nil {
669+
swProfile := &perf.SoftwareProfile{}
670+
if err := (*profiler).Profile(swProfile); err != nil {
662671
return err
663672
}
664673
if swProfile == nil {
@@ -713,8 +722,8 @@ func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error {
713722

714723
func (c *perfCollector) updateCacheStats(ch chan<- prometheus.Metric) error {
715724
for _, profiler := range c.perfCacheProfilers {
716-
cacheProfile, err := (*profiler).Profile()
717-
if err != nil {
725+
cacheProfile := &perf.CacheProfile{}
726+
if err := (*profiler).Profile(cacheProfile); err != nil {
718727
return err
719728
}
720729
if cacheProfile == nil {

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ require (
77
github.com/go-kit/log v0.2.0
88
github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968
99
github.com/hashicorp/go-envparse v0.0.0-20200406174449-d9cfd743a15e
10-
github.com/hodgesds/perf-utils v0.4.0
10+
github.com/hodgesds/perf-utils v0.5.1
1111
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973
12-
github.com/jsimonetti/rtnetlink v0.0.0-20211022192332-93da33804786
12+
github.com/jsimonetti/rtnetlink v1.1.1
1313
github.com/lufia/iostat v1.2.1
1414
github.com/mattn/go-xmlrpc v0.0.3
15-
github.com/mdlayher/wifi v0.0.0-20200527114002-84f0b9457fdd
16-
github.com/prometheus/client_golang v1.11.0
15+
github.com/mdlayher/wifi v0.0.0-20220320220353-954ff73a19a5
16+
github.com/prometheus/client_golang v1.12.1
1717
github.com/prometheus/client_model v0.2.0
18-
github.com/prometheus/common v0.32.1
19-
github.com/prometheus/exporter-toolkit v0.7.0
18+
github.com/prometheus/common v0.33.0
19+
github.com/prometheus/exporter-toolkit v0.7.1
2020
github.com/prometheus/procfs v0.7.4-0.20211011103944-1a7a2bd3279f
21-
github.com/safchain/ethtool v0.1.0
21+
github.com/safchain/ethtool v0.2.0
2222
github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect
2323
github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a
24-
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1
24+
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f
2525
gopkg.in/alecthomas/kingpin.v2 v2.2.6
2626
)
2727

0 commit comments

Comments
 (0)