Skip to content

Commit

Permalink
Merge pull request cloudflare#136 from cloudflare/prom-2.33.0
Browse files Browse the repository at this point in the history
Use Prometheus 2.33.0
  • Loading branch information
prymitive authored Feb 2, 2022
2 parents 63bc066 + 6c8e696 commit c2fd37e
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 53 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v0.8.1

### Changed

- Updated Prometheus modules to [v2.33.0](https://github.com/prometheus/prometheus/releases/tag/v2.33.0).
This adds support for `stripPort` template function.

## v0.8.0

### Added
Expand Down
137 changes: 137 additions & 0 deletions cmd/pint/tests/0042_watch_metrics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ rule {
}

-- metrics.txt --
# HELP go_gc_cycles_automatic_gc_cycles_total Count of completed GC cycles generated by the Go runtime.
# TYPE go_gc_cycles_automatic_gc_cycles_total counter
go_gc_cycles_automatic_gc_cycles_total
# HELP go_gc_cycles_forced_gc_cycles_total Count of completed GC cycles forced by the application.
# TYPE go_gc_cycles_forced_gc_cycles_total counter
go_gc_cycles_forced_gc_cycles_total
# HELP go_gc_cycles_total_gc_cycles_total Count of all completed GC cycles.
# TYPE go_gc_cycles_total_gc_cycles_total counter
go_gc_cycles_total_gc_cycles_total
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"}
Expand All @@ -38,9 +47,119 @@ go_gc_duration_seconds{quantile="0.75"}
go_gc_duration_seconds{quantile="1"}
go_gc_duration_seconds_sum
go_gc_duration_seconds_count
# 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.
# TYPE go_gc_heap_allocs_by_size_bytes_total histogram
go_gc_heap_allocs_by_size_bytes_total_bucket{le="8.999999999999998"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="24.999999999999996"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="64.99999999999999"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="144.99999999999997"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="320.99999999999994"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="704.9999999999999"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="1536.9999999999998"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="3200.9999999999995"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="6528.999999999999"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="13568.999999999998"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="27264.999999999996"}
go_gc_heap_allocs_by_size_bytes_total_bucket{le="+Inf"}
go_gc_heap_allocs_by_size_bytes_total_sum
go_gc_heap_allocs_by_size_bytes_total_count
# HELP go_gc_heap_allocs_bytes_total Cumulative sum of memory allocated to the heap by the application.
# TYPE go_gc_heap_allocs_bytes_total counter
go_gc_heap_allocs_bytes_total
# 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.
# TYPE go_gc_heap_allocs_objects_total counter
go_gc_heap_allocs_objects_total
# 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.
# TYPE go_gc_heap_frees_by_size_bytes_total histogram
go_gc_heap_frees_by_size_bytes_total_bucket{le="8.999999999999998"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="24.999999999999996"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="64.99999999999999"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="144.99999999999997"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="320.99999999999994"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="704.9999999999999"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="1536.9999999999998"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="3200.9999999999995"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="6528.999999999999"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="13568.999999999998"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="27264.999999999996"}
go_gc_heap_frees_by_size_bytes_total_bucket{le="+Inf"}
go_gc_heap_frees_by_size_bytes_total_sum
go_gc_heap_frees_by_size_bytes_total_count
# HELP go_gc_heap_frees_bytes_total Cumulative sum of heap memory freed by the garbage collector.
# TYPE go_gc_heap_frees_bytes_total counter
go_gc_heap_frees_bytes_total
# 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.
# TYPE go_gc_heap_frees_objects_total counter
go_gc_heap_frees_objects_total
# HELP go_gc_heap_goal_bytes Heap size target for the end of the GC cycle.
# TYPE go_gc_heap_goal_bytes gauge
go_gc_heap_goal_bytes
# HELP go_gc_heap_objects_objects Number of objects, live or unswept, occupying heap memory.
# TYPE go_gc_heap_objects_objects gauge
go_gc_heap_objects_objects
# 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.
# TYPE go_gc_heap_tiny_allocs_objects_total counter
go_gc_heap_tiny_allocs_objects_total
# HELP go_gc_pauses_seconds_total Distribution individual GC-related stop-the-world pause latencies.
# TYPE go_gc_pauses_seconds_total histogram
go_gc_pauses_seconds_total_bucket{le="-5e-324"}
go_gc_pauses_seconds_total_bucket{le="9.999999999999999e-10"}
go_gc_pauses_seconds_total_bucket{le="9.999999999999999e-09"}
go_gc_pauses_seconds_total_bucket{le="1.2799999999999998e-07"}
go_gc_pauses_seconds_total_bucket{le="1.2799999999999998e-06"}
go_gc_pauses_seconds_total_bucket{le="1.6383999999999998e-05"}
go_gc_pauses_seconds_total_bucket{le="0.00016383999999999998"}
go_gc_pauses_seconds_total_bucket{le="0.0020971519999999997"}
go_gc_pauses_seconds_total_bucket{le="0.020971519999999997"}
go_gc_pauses_seconds_total_bucket{le="0.26843545599999996"}
go_gc_pauses_seconds_total_bucket{le="+Inf"}
go_gc_pauses_seconds_total_sum NaN
go_gc_pauses_seconds_total_count
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines
# 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.
# TYPE go_memory_classes_heap_free_bytes gauge
go_memory_classes_heap_free_bytes
# 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.
# TYPE go_memory_classes_heap_objects_bytes gauge
go_memory_classes_heap_objects_bytes
# 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.
# TYPE go_memory_classes_heap_released_bytes gauge
go_memory_classes_heap_released_bytes
# 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.
# TYPE go_memory_classes_heap_stacks_bytes gauge
go_memory_classes_heap_stacks_bytes
# HELP go_memory_classes_heap_unused_bytes Memory that is reserved for heap objects but is not currently used to hold heap objects.
# TYPE go_memory_classes_heap_unused_bytes gauge
go_memory_classes_heap_unused_bytes
# HELP go_memory_classes_metadata_mcache_free_bytes Memory that is reserved for runtime mcache structures, but not in-use.
# TYPE go_memory_classes_metadata_mcache_free_bytes gauge
go_memory_classes_metadata_mcache_free_bytes
# HELP go_memory_classes_metadata_mcache_inuse_bytes Memory that is occupied by runtime mcache structures that are currently being used.
# TYPE go_memory_classes_metadata_mcache_inuse_bytes gauge
go_memory_classes_metadata_mcache_inuse_bytes
# HELP go_memory_classes_metadata_mspan_free_bytes Memory that is reserved for runtime mspan structures, but not in-use.
# TYPE go_memory_classes_metadata_mspan_free_bytes gauge
go_memory_classes_metadata_mspan_free_bytes
# HELP go_memory_classes_metadata_mspan_inuse_bytes Memory that is occupied by runtime mspan structures that are currently being used.
# TYPE go_memory_classes_metadata_mspan_inuse_bytes gauge
go_memory_classes_metadata_mspan_inuse_bytes
# HELP go_memory_classes_metadata_other_bytes Memory that is reserved for or used to hold runtime metadata.
# TYPE go_memory_classes_metadata_other_bytes gauge
go_memory_classes_metadata_other_bytes
# HELP go_memory_classes_os_stacks_bytes Stack memory allocated by the underlying operating system.
# TYPE go_memory_classes_os_stacks_bytes gauge
go_memory_classes_os_stacks_bytes
# HELP go_memory_classes_other_bytes Memory used by execution trace buffers, structures for debugging the runtime, finalizer and profiler specials, and more.
# TYPE go_memory_classes_other_bytes gauge
go_memory_classes_other_bytes
# HELP go_memory_classes_profiling_buckets_bytes Memory that is used by the stack trace hash map used for profiling.
# TYPE go_memory_classes_profiling_buckets_bytes gauge
go_memory_classes_profiling_buckets_bytes
# 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.
# TYPE go_memory_classes_total_bytes gauge
go_memory_classes_total_bytes
# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
# TYPE go_memstats_alloc_bytes gauge
go_memstats_alloc_bytes
Expand Down Expand Up @@ -113,6 +232,24 @@ go_memstats_stack_sys_bytes
# HELP go_memstats_sys_bytes Number of bytes obtained from system.
# TYPE go_memstats_sys_bytes gauge
go_memstats_sys_bytes
# HELP go_sched_goroutines_goroutines Count of live goroutines.
# TYPE go_sched_goroutines_goroutines gauge
go_sched_goroutines_goroutines
# HELP go_sched_latencies_seconds Distribution of the time goroutines have spent in the scheduler in a runnable state before actually running.
# TYPE go_sched_latencies_seconds histogram
go_sched_latencies_seconds_bucket{le="-5e-324"}
go_sched_latencies_seconds_bucket{le="9.999999999999999e-10"}
go_sched_latencies_seconds_bucket{le="9.999999999999999e-09"}
go_sched_latencies_seconds_bucket{le="1.2799999999999998e-07"}
go_sched_latencies_seconds_bucket{le="1.2799999999999998e-06"}
go_sched_latencies_seconds_bucket{le="1.6383999999999998e-05"}
go_sched_latencies_seconds_bucket{le="0.00016383999999999998"}
go_sched_latencies_seconds_bucket{le="0.0020971519999999997"}
go_sched_latencies_seconds_bucket{le="0.020971519999999997"}
go_sched_latencies_seconds_bucket{le="0.26843545599999996"}
go_sched_latencies_seconds_bucket{le="+Inf"}
go_sched_latencies_seconds_sum NaN
go_sched_latencies_seconds_count
# HELP go_threads Number of OS threads created.
# TYPE go_threads gauge
go_threads
Expand Down
19 changes: 19 additions & 0 deletions cmd/pint/tests/0046_parse_3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pint.ok parse 'sum(http_requests_total{method="GET"} @ 1609746000)'
cmp stdout stdout.txt
! stderr .

-- stdout.txt --
++ node: sum(http_requests_total{method="GET"} @ 1609746000.000)
AggregateExpr:
* Type: vector
* Op: sum
* Expr: http_requests_total{method="GET"} @ 1609746000.000
* Param: <nil>
* Grouping: []
* Without: false
++ node: http_requests_total{method="GET"} @ 1609746000.000
VectorSelector:
* Type: vector
* Name: http_requests_total
* Offset: 0s
* LabelMatchers: [method="GET" __name__="http_requests_total"]
17 changes: 17 additions & 0 deletions cmd/pint/tests/0047_parse_4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pint.ok parse 'rate(http_requests_total[5m] offset -1w)'
cmp stdout stdout.txt
! stderr .

-- stdout.txt --
++ node: rate(http_requests_total[5m] offset -1w)
Call:
* Type: vector
* Func: rate
* Args: http_requests_total[5m] offset -1w
++ node: http_requests_total[5m] offset -1w
Expressions:
++ node: http_requests_total[5m] offset -1w
MatrixSelector:
* Type: matrix
* VectorSelector: http_requests_total offset -1w
* Range: 5m0s
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ require (
github.com/google/go-github/v37 v37.0.0
github.com/hashicorp/golang-lru v0.5.4
github.com/hashicorp/hcl/v2 v2.11.1
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.32.1
github.com/prometheus/prometheus v1.8.2-0.20211217191541-41f1a8125e66
github.com/prometheus/prometheus v1.8.2-0.20220129212040-344a13d96087
github.com/rogpeppe/go-internal v1.8.1
github.com/rs/zerolog v1.26.1
github.com/stretchr/testify v1.7.0
Expand All @@ -26,7 +26,7 @@ require (
github.com/agext/levenshtein v1.2.3 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/aws/aws-sdk-go v1.42.26 // indirect
github.com/aws/aws-sdk-go v1.42.44 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
Expand Down Expand Up @@ -65,10 +65,10 @@ require (
github.com/zclconf/go-cty v1.10.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e // indirect
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
Expand Down
Loading

0 comments on commit c2fd37e

Please sign in to comment.