prometheus

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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