vendor: update github.com/VictoriaMetrics/metrics from v1.21.0 to v1.22.1

This commit is contained in:
Aliaksandr Valialkin 2022-08-08 17:18:42 +03:00
parent 06b6063a36
commit 1a851b14c9
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
11 changed files with 204 additions and 130 deletions

2
go.mod
View file

@ -9,7 +9,7 @@ require (
// Do not use the original github.com/valyala/fasthttp because of issues // Do not use the original github.com/valyala/fasthttp because of issues
// like https://github.com/valyala/fasthttp/commit/996610f021ff45fdc98c2ce7884d5fa4e7f9199b // like https://github.com/valyala/fasthttp/commit/996610f021ff45fdc98c2ce7884d5fa4e7f9199b
github.com/VictoriaMetrics/fasthttp v1.1.0 github.com/VictoriaMetrics/fasthttp v1.1.0
github.com/VictoriaMetrics/metrics v1.21.0 github.com/VictoriaMetrics/metrics v1.22.1
github.com/VictoriaMetrics/metricsql v0.44.1 github.com/VictoriaMetrics/metricsql v0.44.1
github.com/aws/aws-sdk-go v1.44.70 github.com/aws/aws-sdk-go v1.44.70
github.com/cespare/xxhash/v2 v2.1.2 github.com/cespare/xxhash/v2 v2.1.2

4
go.sum
View file

@ -109,8 +109,8 @@ github.com/VictoriaMetrics/fastcache v1.10.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJ
github.com/VictoriaMetrics/fasthttp v1.1.0 h1:3crd4YWHsMwu60GUXRH6OstowiFvqrwS4a/ueoLdLL0= github.com/VictoriaMetrics/fasthttp v1.1.0 h1:3crd4YWHsMwu60GUXRH6OstowiFvqrwS4a/ueoLdLL0=
github.com/VictoriaMetrics/fasthttp v1.1.0/go.mod h1:/7DMcogqd+aaD3G3Hg5kFgoFwlR2uydjiWvoLp5ZTqQ= github.com/VictoriaMetrics/fasthttp v1.1.0/go.mod h1:/7DMcogqd+aaD3G3Hg5kFgoFwlR2uydjiWvoLp5ZTqQ=
github.com/VictoriaMetrics/metrics v1.18.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA= github.com/VictoriaMetrics/metrics v1.18.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA=
github.com/VictoriaMetrics/metrics v1.21.0 h1:cjbToD4xrR+ZaDO49h2t67sdmmbCKfHfyTyAH3Sx+DM= github.com/VictoriaMetrics/metrics v1.22.1 h1:ExNLLZ0HLI41imYDaWbeVXfMB2+0W4ovBSk3It+Y9+c=
github.com/VictoriaMetrics/metrics v1.21.0/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA= github.com/VictoriaMetrics/metrics v1.22.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA=
github.com/VictoriaMetrics/metricsql v0.44.1 h1:qGoRt0g84uMUscVjS7P3uDZKmjJubWKaIx9v0iHKgck= github.com/VictoriaMetrics/metricsql v0.44.1 h1:qGoRt0g84uMUscVjS7P3uDZKmjJubWKaIx9v0iHKgck=
github.com/VictoriaMetrics/metricsql v0.44.1/go.mod h1:6pP1ZeLVJHqJrHlF6Ij3gmpQIznSsgktEcZgsAWYel0= github.com/VictoriaMetrics/metricsql v0.44.1/go.mod h1:6pP1ZeLVJHqJrHlF6Ij3gmpQIznSsgktEcZgsAWYel0=
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=

View file

@ -11,9 +11,9 @@ import (
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned counter is safe to use from concurrent goroutines. // The returned counter is safe to use from concurrent goroutines.
func NewCounter(name string) *Counter { func NewCounter(name string) *Counter {
@ -65,9 +65,9 @@ func (c *Counter) marshalTo(prefix string, w io.Writer) {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned counter is safe to use from concurrent goroutines. // The returned counter is safe to use from concurrent goroutines.
// //

View file

@ -11,9 +11,9 @@ import (
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned counter is safe to use from concurrent goroutines. // The returned counter is safe to use from concurrent goroutines.
func NewFloatCounter(name string) *FloatCounter { func NewFloatCounter(name string) *FloatCounter {
@ -70,9 +70,9 @@ func (fc *FloatCounter) marshalTo(prefix string, w io.Writer) {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned FloatCounter is safe to use from concurrent goroutines. // The returned FloatCounter is safe to use from concurrent goroutines.
// //

View file

@ -11,9 +11,9 @@ import (
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// f must be safe for concurrent calls. // f must be safe for concurrent calls.
// //
@ -53,9 +53,9 @@ func (g *Gauge) marshalTo(prefix string, w io.Writer) {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned gauge is safe to use from concurrent goroutines. // The returned gauge is safe to use from concurrent goroutines.
// //

View file

@ -25,20 +25,20 @@ var bucketMultiplier = math.Pow(10, 1.0/bucketsPerDecimal)
// Each bucket contains a counter for values in the given range. // Each bucket contains a counter for values in the given range.
// Each non-empty bucket is exposed via the following metric: // Each non-empty bucket is exposed via the following metric:
// //
// <metric_name>_bucket{<optional_tags>,vmrange="<start>...<end>"} <counter> // <metric_name>_bucket{<optional_tags>,vmrange="<start>...<end>"} <counter>
// //
// Where: // Where:
// //
// - <metric_name> is the metric name passed to NewHistogram // - <metric_name> is the metric name passed to NewHistogram
// - <optional_tags> is optional tags for the <metric_name>, which are passed to NewHistogram // - <optional_tags> is optional tags for the <metric_name>, which are passed to NewHistogram
// - <start> and <end> - start and end values for the given bucket // - <start> and <end> - start and end values for the given bucket
// - <counter> - the number of hits to the given bucket during Update* calls // - <counter> - the number of hits to the given bucket during Update* calls
// //
// Histogram buckets can be converted to Prometheus-like buckets with `le` labels // Histogram buckets can be converted to Prometheus-like buckets with `le` labels
// with `prometheus_buckets(<metric_name>_bucket)` function from PromQL extensions in VictoriaMetrics. // with `prometheus_buckets(<metric_name>_bucket)` function from PromQL extensions in VictoriaMetrics.
// (see https://github.com/VictoriaMetrics/VictoriaMetrics/wiki/MetricsQL ): // (see https://github.com/VictoriaMetrics/VictoriaMetrics/wiki/MetricsQL ):
// //
// prometheus_buckets(request_duration_bucket) // prometheus_buckets(request_duration_bucket)
// //
// Time series produced by the Histogram have better compression ratio comparing to // Time series produced by the Histogram have better compression ratio comparing to
// Prometheus histogram buckets with `le` labels, since they don't include counters // Prometheus histogram buckets with `le` labels, since they don't include counters
@ -143,9 +143,9 @@ func (h *Histogram) VisitNonZeroBuckets(f func(vmrange string, count uint64)) {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned histogram is safe to use from concurrent goroutines. // The returned histogram is safe to use from concurrent goroutines.
func NewHistogram(name string) *Histogram { func NewHistogram(name string) *Histogram {
@ -159,9 +159,9 @@ func NewHistogram(name string) *Histogram {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned histogram is safe to use from concurrent goroutines. // The returned histogram is safe to use from concurrent goroutines.
// //

View file

@ -5,15 +5,18 @@
// //
// Usage: // Usage:
// //
// 1. Register the required metrics via New* functions. // 1. Register the required metrics via New* functions.
// 2. Expose them to `/metrics` page via WritePrometheus. // 2. Expose them to `/metrics` page via WritePrometheus.
// 3. Update the registered metrics during application lifetime. // 3. Update the registered metrics during application lifetime.
// //
// The package has been extracted from https://victoriametrics.com/ // The package has been extracted from https://victoriametrics.com/
package metrics package metrics
import ( import (
"io" "io"
"sort"
"sync"
"unsafe"
) )
type namedMetric struct { type namedMetric struct {
@ -27,19 +30,57 @@ type metric interface {
var defaultSet = NewSet() var defaultSet = NewSet()
// WritePrometheus writes all the registered metrics in Prometheus format to w. func init() {
RegisterSet(defaultSet)
}
var (
registeredSets = make(map[*Set]struct{})
registeredSetsLock sync.Mutex
)
// RegisterSet registers the given set s for metrics export via global WritePrometheus() call.
//
// See also UnregisterSet.
func RegisterSet(s *Set) {
registeredSetsLock.Lock()
registeredSets[s] = struct{}{}
registeredSetsLock.Unlock()
}
// UnregisterSet stops exporting metrics for the given s via global WritePrometheus() call.
func UnregisterSet(s *Set) {
registeredSetsLock.Lock()
delete(registeredSets, s)
registeredSetsLock.Unlock()
}
// WritePrometheus writes all the metrics from default set and all the registered sets in Prometheus format to w.
//
// Additional sets can be registered via RegisterSet() call.
// //
// If exposeProcessMetrics is true, then various `go_*` and `process_*` metrics // If exposeProcessMetrics is true, then various `go_*` and `process_*` metrics
// are exposed for the current process. // are exposed for the current process.
// //
// The WritePrometheus func is usually called inside "/metrics" handler: // The WritePrometheus func is usually called inside "/metrics" handler:
// //
// http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) { // http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
// metrics.WritePrometheus(w, true) // metrics.WritePrometheus(w, true)
// }) // })
//
func WritePrometheus(w io.Writer, exposeProcessMetrics bool) { func WritePrometheus(w io.Writer, exposeProcessMetrics bool) {
defaultSet.WritePrometheus(w) registeredSetsLock.Lock()
sets := make([]*Set, 0, len(registeredSets))
for s := range registeredSets {
sets = append(sets, s)
}
registeredSetsLock.Unlock()
sort.Slice(sets, func(i, j int) bool {
return uintptr(unsafe.Pointer(sets[i])) < uintptr(unsafe.Pointer(sets[j]))
})
for _, s := range sets {
s.WritePrometheus(w)
}
if exposeProcessMetrics { if exposeProcessMetrics {
WriteProcessMetrics(w) WriteProcessMetrics(w)
} }
@ -50,50 +91,81 @@ func WritePrometheus(w io.Writer, exposeProcessMetrics bool) {
// The following `go_*` and `process_*` metrics are exposed for the currently // The following `go_*` and `process_*` metrics are exposed for the currently
// running process. Below is a short description for the exposed `process_*` metrics: // running process. Below is a short description for the exposed `process_*` metrics:
// //
// - process_cpu_seconds_system_total - CPU time spent in syscalls // - process_cpu_seconds_system_total - CPU time spent in syscalls
// - process_cpu_seconds_user_total - CPU time spent in userspace
// - process_cpu_seconds_total - CPU time spent by the process
// - process_major_pagefaults_total - page faults resulted in disk IO
// - process_minor_pagefaults_total - page faults resolved without disk IO
// - process_resident_memory_bytes - recently accessed memory (aka RSS or resident memory)
// - process_resident_memory_peak_bytes - the maximum RSS memory usage
// - process_resident_memory_anon_bytes - RSS for memory-mapped files
// - process_resident_memory_file_bytes - RSS for memory allocated by the process
// - process_resident_memory_shared_bytes - RSS for memory shared between multiple processes
// - process_virtual_memory_bytes - virtual memory usage
// - process_virtual_memory_peak_bytes - the maximum virtual memory usage
// - process_num_threads - the number of threads
// - process_start_time_seconds - process start time as unix timestamp
// //
// - process_io_read_bytes_total - the number of bytes read via syscalls // - process_cpu_seconds_user_total - CPU time spent in userspace
// - process_io_written_bytes_total - the number of bytes written via syscalls
// - process_io_read_syscalls_total - the number of read syscalls
// - process_io_write_syscalls_total - the number of write syscalls
// - process_io_storage_read_bytes_total - the number of bytes actually read from disk
// - process_io_storage_written_bytes_total - the number of bytes actually written to disk
// //
// - go_memstats_alloc_bytes - memory usage for Go objects in the heap // - process_cpu_seconds_total - CPU time spent by the process
// - go_memstats_alloc_bytes_total - the cumulative counter for total size of allocated Go objects //
// - go_memstats_frees_total - the cumulative counter for number of freed Go objects // - process_major_pagefaults_total - page faults resulted in disk IO
// - go_memstats_gc_cpu_fraction - the fraction of CPU spent in Go garbage collector //
// - go_memstats_gc_sys_bytes - the size of Go garbage collector metadata // - process_minor_pagefaults_total - page faults resolved without disk IO
// - go_memstats_heap_alloc_bytes - the same as go_memstats_alloc_bytes //
// - go_memstats_heap_idle_bytes - idle memory ready for new Go object allocations // - process_resident_memory_bytes - recently accessed memory (aka RSS or resident memory)
// - go_memstats_heap_objects - the number of Go objects in the heap //
// - go_memstats_heap_sys_bytes - memory requested for Go objects from the OS // - process_resident_memory_peak_bytes - the maximum RSS memory usage
// - go_memstats_mallocs_total - the number of allocations for Go objects //
// - go_memstats_next_gc_bytes - the target heap size when the next garbage collection should start // - process_resident_memory_anon_bytes - RSS for memory-mapped files
// - go_memstats_stack_inuse_bytes - memory used for goroutine stacks //
// - go_memstats_stack_sys_bytes - memory requested fromthe OS for goroutine stacks // - process_resident_memory_file_bytes - RSS for memory allocated by the process
// - go_memstats_sys_bytes - memory requested by Go runtime from the OS //
// - process_resident_memory_shared_bytes - RSS for memory shared between multiple processes
//
// - process_virtual_memory_bytes - virtual memory usage
//
// - process_virtual_memory_peak_bytes - the maximum virtual memory usage
//
// - process_num_threads - the number of threads
//
// - process_start_time_seconds - process start time as unix timestamp
//
// - process_io_read_bytes_total - the number of bytes read via syscalls
//
// - process_io_written_bytes_total - the number of bytes written via syscalls
//
// - process_io_read_syscalls_total - the number of read syscalls
//
// - process_io_write_syscalls_total - the number of write syscalls
//
// - process_io_storage_read_bytes_total - the number of bytes actually read from disk
//
// - process_io_storage_written_bytes_total - the number of bytes actually written to disk
//
// - go_memstats_alloc_bytes - memory usage for Go objects in the heap
//
// - go_memstats_alloc_bytes_total - the cumulative counter for total size of allocated Go objects
//
// - go_memstats_frees_total - the cumulative counter for number of freed Go objects
//
// - go_memstats_gc_cpu_fraction - the fraction of CPU spent in Go garbage collector
//
// - go_memstats_gc_sys_bytes - the size of Go garbage collector metadata
//
// - go_memstats_heap_alloc_bytes - the same as go_memstats_alloc_bytes
//
// - go_memstats_heap_idle_bytes - idle memory ready for new Go object allocations
//
// - go_memstats_heap_objects - the number of Go objects in the heap
//
// - go_memstats_heap_sys_bytes - memory requested for Go objects from the OS
//
// - go_memstats_mallocs_total - the number of allocations for Go objects
//
// - go_memstats_next_gc_bytes - the target heap size when the next garbage collection should start
//
// - go_memstats_stack_inuse_bytes - memory used for goroutine stacks
//
// - go_memstats_stack_sys_bytes - memory requested fromthe OS for goroutine stacks
//
// - go_memstats_sys_bytes - memory requested by Go runtime from the OS
// //
// The WriteProcessMetrics func is usually called in combination with writing Set metrics // The WriteProcessMetrics func is usually called in combination with writing Set metrics
// inside "/metrics" handler: // inside "/metrics" handler:
// //
// http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) { // http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
// mySet.WritePrometheus(w) // mySet.WritePrometheus(w)
// metrics.WriteProcessMetrics(w) // metrics.WriteProcessMetrics(w)
// }) // })
// //
// See also WrteFDMetrics. // See also WrteFDMetrics.
func WriteProcessMetrics(w io.Writer) { func WriteProcessMetrics(w io.Writer) {

View file

@ -60,7 +60,7 @@ func InitPush(pushURL string, interval time.Duration, extraLabels string, pushPr
// extraLabels may contain comma-separated list of `label="value"` labels, which will be added // extraLabels may contain comma-separated list of `label="value"` labels, which will be added
// to all the metrics before pushing them to pushURL. // to all the metrics before pushing them to pushURL.
// //
/// The metrics are pushed to pushURL in Prometheus text exposition format. // / The metrics are pushed to pushURL in Prometheus text exposition format.
// See https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-based-format // See https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-based-format
// //
// It is recommended pushing metrics to /api/v1/import/prometheus endpoint according to // It is recommended pushing metrics to /api/v1/import/prometheus endpoint according to

View file

@ -22,6 +22,8 @@ type Set struct {
} }
// NewSet creates new set of metrics. // NewSet creates new set of metrics.
//
// Pass the set to RegisterSet() function in order to export its metrics via global WritePrometheus() call.
func NewSet() *Set { func NewSet() *Set {
return &Set{ return &Set{
m: make(map[string]*namedMetric), m: make(map[string]*namedMetric),
@ -58,9 +60,9 @@ func (s *Set) WritePrometheus(w io.Writer) {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned histogram is safe to use from concurrent goroutines. // The returned histogram is safe to use from concurrent goroutines.
func (s *Set) NewHistogram(name string) *Histogram { func (s *Set) NewHistogram(name string) *Histogram {
@ -75,9 +77,9 @@ func (s *Set) NewHistogram(name string) *Histogram {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned histogram is safe to use from concurrent goroutines. // The returned histogram is safe to use from concurrent goroutines.
// //
@ -116,9 +118,9 @@ func (s *Set) GetOrCreateHistogram(name string) *Histogram {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned counter is safe to use from concurrent goroutines. // The returned counter is safe to use from concurrent goroutines.
func (s *Set) NewCounter(name string) *Counter { func (s *Set) NewCounter(name string) *Counter {
@ -133,9 +135,9 @@ func (s *Set) NewCounter(name string) *Counter {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned counter is safe to use from concurrent goroutines. // The returned counter is safe to use from concurrent goroutines.
// //
@ -174,9 +176,9 @@ func (s *Set) GetOrCreateCounter(name string) *Counter {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned FloatCounter is safe to use from concurrent goroutines. // The returned FloatCounter is safe to use from concurrent goroutines.
func (s *Set) NewFloatCounter(name string) *FloatCounter { func (s *Set) NewFloatCounter(name string) *FloatCounter {
@ -191,9 +193,9 @@ func (s *Set) NewFloatCounter(name string) *FloatCounter {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned FloatCounter is safe to use from concurrent goroutines. // The returned FloatCounter is safe to use from concurrent goroutines.
// //
@ -233,9 +235,9 @@ func (s *Set) GetOrCreateFloatCounter(name string) *FloatCounter {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// f must be safe for concurrent calls. // f must be safe for concurrent calls.
// //
@ -257,9 +259,9 @@ func (s *Set) NewGauge(name string, f func() float64) *Gauge {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned gauge is safe to use from concurrent goroutines. // The returned gauge is safe to use from concurrent goroutines.
// //
@ -303,9 +305,9 @@ func (s *Set) GetOrCreateGauge(name string, f func() float64) *Gauge {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
func (s *Set) NewSummary(name string) *Summary { func (s *Set) NewSummary(name string) *Summary {
@ -318,9 +320,9 @@ func (s *Set) NewSummary(name string) *Summary {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
func (s *Set) NewSummaryExt(name string, window time.Duration, quantiles []float64) *Summary { func (s *Set) NewSummaryExt(name string, window time.Duration, quantiles []float64) *Summary {
@ -347,9 +349,9 @@ func (s *Set) NewSummaryExt(name string, window time.Duration, quantiles []float
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
// //
@ -365,9 +367,9 @@ func (s *Set) GetOrCreateSummary(name string) *Summary {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
// //

View file

@ -36,9 +36,9 @@ type Summary struct {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
func NewSummary(name string) *Summary { func NewSummary(name string) *Summary {
@ -51,9 +51,9 @@ func NewSummary(name string) *Summary {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
func NewSummaryExt(name string, window time.Duration, quantiles []float64) *Summary { func NewSummaryExt(name string, window time.Duration, quantiles []float64) *Summary {
@ -140,9 +140,9 @@ func (sm *Summary) updateQuantiles() {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
// //
@ -158,9 +158,9 @@ func GetOrCreateSummary(name string) *Summary {
// name must be valid Prometheus-compatible metric with possible labels. // name must be valid Prometheus-compatible metric with possible labels.
// For instance, // For instance,
// //
// * foo // - foo
// * foo{bar="baz"} // - foo{bar="baz"}
// * foo{bar="baz",aaa="b"} // - foo{bar="baz",aaa="b"}
// //
// The returned summary is safe to use from concurrent goroutines. // The returned summary is safe to use from concurrent goroutines.
// //

2
vendor/modules.txt vendored
View file

@ -25,7 +25,7 @@ github.com/VictoriaMetrics/fastcache
github.com/VictoriaMetrics/fasthttp github.com/VictoriaMetrics/fasthttp
github.com/VictoriaMetrics/fasthttp/fasthttputil github.com/VictoriaMetrics/fasthttp/fasthttputil
github.com/VictoriaMetrics/fasthttp/stackless github.com/VictoriaMetrics/fasthttp/stackless
# github.com/VictoriaMetrics/metrics v1.21.0 # github.com/VictoriaMetrics/metrics v1.22.1
## explicit; go 1.12 ## explicit; go 1.12
github.com/VictoriaMetrics/metrics github.com/VictoriaMetrics/metrics
# github.com/VictoriaMetrics/metricsql v0.44.1 # github.com/VictoriaMetrics/metricsql v0.44.1