metric

package
v0.0.0-...-d691e2b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricTypeCounter   metricType = "counter"
	MetricTypeGauge     metricType = "gauge"
	MetricTypeHistogram metricType = "histogram"
)

Variables

This section is empty.

Functions

func Add

func Add(index string, value float64, labels ...string)

func AddGauge

func AddGauge(index string, value float64, labels ...string)

func AddWithLabels

func AddWithLabels(index string, value float64, labels *prometheus.Labels)

func GetCounterValue

func GetCounterValue(index string, labels ...string) float64

func Inc

func Inc(index string, labels ...string)

func IncWithLabels

func IncWithLabels(index string, labels *prometheus.Labels)

func InitMetric

func InitMetric(namespace string)

func Observe

func Observe(index string, value float64, labels ...string)

func ObserveWithLabels

func ObserveWithLabels(index string, value float64, labels *prometheus.Labels)

func Register

func Register(subsystem string, configs []MetricConfig) error

func SetGauge

func SetGauge(index string, value float64, labels ...string)

func SetGaugeWithLabels

func SetGaugeWithLabels(index string, value float64, labels *prometheus.Labels)

func SubGauge

func SubGauge(index string, value float64, labels ...string)

Types

type MetricConfig

type MetricConfig struct {
	Index        string
	Name         string
	Labels       []string
	HelpTemplate string
	Buckets      []float64
	MetricType   metricType
	HasSummary   bool
}

func (*MetricConfig) Validator

func (m *MetricConfig) Validator() error

Jump to

Keyboard shortcuts

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