prometheus

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LazyCounter

type LazyCounter struct {
	Counter  prometheus.Counter
	Registry *prometheus.Registry
	// contains filtered or unexported fields
}

LazyCounter wraps a prometheus Gauge but doesn't register itself until Set is called This avoids a bunch of registered metrics with "0" initial values showing up when scraped, and generally helps the resulting data in graphs look cleaner

func (*LazyCounter) Add

func (l *LazyCounter) Add(val float64)

Add wraps prometheus.Counter.Add with a call to MustRegister

func (*LazyCounter) Inc

func (l *LazyCounter) Inc()

Inc wraps prometheus.Counter.Inc with a call to MustRegister

func (*LazyCounter) Unregister

func (l *LazyCounter) Unregister()

Unregister removes the metric from the Registry to stop reporting it until it is registered again

type LazyGauge

type LazyGauge struct {
	Gauge    prometheus.Gauge
	Registry *prometheus.Registry
	// contains filtered or unexported fields
}

LazyGauge wraps a prometheus Gauge but doesn't register itself until Set is called This avoids a bunch of registered metrics with "0" initial values showing up when scraped, and generally helps the resulting data in graphs look cleaner

func (*LazyGauge) Set

func (l *LazyGauge) Set(val float64)

Set wraps prometheus.Set with a call to MustRegister

func (*LazyGauge) Unregister

func (l *LazyGauge) Unregister()

Unregister removes the metric from the Registry to stop reporting it until it is registered again

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL