metrics

package
v0.0.1-RC3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Counter

func Counter(name string) (counter prometheus.Counter, exist bool)

Counter retrieves counter metric by name

func CounterAdd

func CounterAdd(name string, value float64)

CounterAdd increments the counter with the given name.

func CounterInc

func CounterInc(name string)

CounterInc increments the counter with the given name.

func CounterVec

func CounterVec(name string) (counterVec *prometheus.CounterVec, exist bool)

CounterVec retrieves counter ver metric by name

func CounterVecAdd

func CounterVecAdd(name string, label string, value float64)

CounterVecAdd increments the counter vec by the given value, with the given name and label.

func CounterVecInc

func CounterVecInc(name string, label string)

CounterVecInc increments the counter vec with the given name and label.

func Gauge

func Gauge(name string) (gauge prometheus.Gauge, exist bool)

Gauge retrieves gauge metric by name

func GaugeSet

func GaugeSet(name string, value float64)

GaugeSet sets the value for gauge with the given name.

func Handler

func Handler() http.Handler

Handler returns the Prometheus http handler.

func Histogram

func Histogram(name string) (histogram prometheus.Histogram, exist bool)

Histogram retrieves histogram metric by name

func HistogramObserve

func HistogramObserve(name string, value float64)

HistogramObserve observes the histogram from the given start time.

func Init

func Init()

Init initializes the package variables.

func RegisterCounterVecs

func RegisterCounterVecs(opts ...CounterVecOpts)

RegisterCounterVecs registers the provided counter vec metrics to the Prometheus registerer.

func RegisterCounters

func RegisterCounters(opts ...prometheus.CounterOpts)

RegisterCounters registers the provided counter metrics to the Prometheus registerer.

func RegisterGauges

func RegisterGauges(opts ...prometheus.GaugeOpts)

RegisterGauges registers the provided gauge metrics to the Prometheus registerer.

func RegisterHistograms

func RegisterHistograms(opts ...prometheus.HistogramOpts)

RegisterHistograms registers the provided histogram metrics to the Prometheus registerer.

func RegisterSummaries

func RegisterSummaries(opts ...prometheus.SummaryOpts)

RegisterSummaries registers the provided summary metrics to the Prometheus registerer.

func Summary

func Summary(name string) (summary prometheus.Summary, exist bool)

Summary retrieves summary metric by name

func UnregisterCounterVecs

func UnregisterCounterVecs(names ...string)

UnregisterCounterVecs unregisters the provided counter vec metrics from the Prometheus registerer.

func UnregisterCounters

func UnregisterCounters(names ...string)

UnregisterCounters unregisters the provided counter metrics from the Prometheus registerer.

func UnregisterGauges

func UnregisterGauges(names ...string)

UnregisterGauges unregisters the provided gauge metrics from the Prometheus registerer.

func UnregisterHistogram

func UnregisterHistogram(names ...string)

UnregisterHistogram unregisters the provided histogram metrics from the Prometheus registerer.

func UnregisterSummaries

func UnregisterSummaries(names ...string)

UnregisterSummaries unregisters the provided summary metrics from the Prometheus registerer.

Types

type Config

type Config struct {
	Host    string `mapstructure:"Host"`
	Port    int    `mapstructure:"Port"`
	Enabled bool   `mapstructure:"Enabled"`
}

Config represents the configuration of the metrics

type CounterVecOpts

type CounterVecOpts struct {
	prometheus.CounterOpts
	Labels []string
}

CounterVecOpts holds options for the CounterVec type.

Jump to

Keyboard shortcuts

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