metrics

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Overview

Metrics package is a wrapper around prometheus Registry+metrics It allows storing, removing and retrieving metrics by a unique string identifier

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameEmpty           = errors.New("metric name cannot be empty")
	ErrMetricNil           = errors.New("metric cannot be nil")
	ErrMetricAlreadyExists = errors.New("metric already exists")
	ErrMetricNotFound      = errors.New("metric not found")
	ErrInvalidType         = errors.New("metric of invalid type found")
)

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(namespace string, prometheusRegistry *prometheus.Registry) (registry *Registry, err error)

func (*Registry) Get

func (registry *Registry) Get(name string) (c prometheus.Collector, err error)

func (*Registry) GetPrometheusRegistry

func (registry *Registry) GetPrometheusRegistry() *prometheus.Registry

func (*Registry) HTTPHandler

func (registry *Registry) HTTPHandler() http.Handler

func (*Registry) NewCounter added in v0.0.12

func (registry *Registry) NewCounter(opts prometheus.CounterOpts) prometheus.Counter

Counter

func (*Registry) NewCounterVec

func (registry *Registry) NewCounterVec(opts prometheus.CounterOpts, labels []string) *prometheus.CounterVec

CounterVec

func (*Registry) NewGauge added in v0.0.19

func (registry *Registry) NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge

Gauge

func (*Registry) NewGaugeVec added in v0.0.19

func (registry *Registry) NewGaugeVec(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec

GaugeVec

func (*Registry) NewSummaryVec

func (registry *Registry) NewSummaryVec(opts prometheus.SummaryOpts, labels []string) *prometheus.SummaryVec

SummaryVec

func (*Registry) Register

func (registry *Registry) Register(name string, c prometheus.Collector) (err error)

func (*Registry) RegisterNewCounter added in v0.0.12

func (registry *Registry) RegisterNewCounter(name string, opts prometheus.CounterOpts) (c prometheus.Counter, err error)

func (*Registry) RegisterNewCounterVec

func (registry *Registry) RegisterNewCounterVec(name string, opts prometheus.CounterOpts, labels []string) (c *prometheus.CounterVec, err error)

func (*Registry) RegisterNewGauge added in v0.0.19

func (registry *Registry) RegisterNewGauge(name string, opts prometheus.GaugeOpts) (c prometheus.Gauge, err error)

func (*Registry) RegisterNewGaugeVec added in v0.0.19

func (registry *Registry) RegisterNewGaugeVec(name string, opts prometheus.GaugeOpts, labels []string) (c *prometheus.GaugeVec, err error)

func (*Registry) RegisterNewSummaryVec

func (registry *Registry) RegisterNewSummaryVec(name string, opts prometheus.SummaryOpts, labels []string) (c *prometheus.SummaryVec, err error)

func (*Registry) RegisterOrGet added in v0.2.0

func (registry *Registry) RegisterOrGet(name string, c prometheus.Collector) (cRegistered prometheus.Collector, err error)

func (*Registry) RegisterOrGetNewCounter added in v0.2.0

func (registry *Registry) RegisterOrGetNewCounter(name string, opts prometheus.CounterOpts) (c prometheus.Counter, err error)

func (*Registry) RegisterOrGetNewCounterVec added in v0.2.0

func (registry *Registry) RegisterOrGetNewCounterVec(name string, opts prometheus.CounterOpts, labels []string) (c *prometheus.CounterVec, err error)

func (*Registry) RegisterOrGetNewGauge added in v0.2.0

func (registry *Registry) RegisterOrGetNewGauge(name string, opts prometheus.GaugeOpts) (c prometheus.Gauge, err error)

func (*Registry) RegisterOrGetNewGaugeVec added in v0.2.0

func (registry *Registry) RegisterOrGetNewGaugeVec(name string, opts prometheus.GaugeOpts, labels []string) (c *prometheus.GaugeVec, err error)

func (*Registry) RegisterOrGetNewSummaryVec added in v0.2.0

func (registry *Registry) RegisterOrGetNewSummaryVec(name string, opts prometheus.SummaryOpts, labels []string) (c *prometheus.SummaryVec, err error)

func (*Registry) Unregister

func (registry *Registry) Unregister(name string) (err error)

Jump to

Keyboard shortcuts

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