metric_storage

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 7

Documentation

Index

Constants

View Source
const (
	PrefixTemplate = "{PREFIX}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricStorage

type MetricStorage struct {
	Prefix string

	Counters         map[string]*prometheus.CounterVec
	Gauges           map[string]*prometheus.GaugeVec
	Histograms       map[string]*prometheus.HistogramVec
	HistogramBuckets map[string][]float64

	GroupedVault *vault.GroupedVault

	Registry   *prometheus.Registry
	Gatherer   prometheus.Gatherer
	Registerer prometheus.Registerer
	// contains filtered or unexported fields
}

MetricStorage is used to register metric values.

func NewMetricStorage

func NewMetricStorage(ctx context.Context, prefix string, newRegistry bool) *MetricStorage

func (*MetricStorage) ApplyOperation

func (m *MetricStorage) ApplyOperation(op operation.MetricOperation, commonLabels map[string]string)

func (*MetricStorage) Counter

func (m *MetricStorage) Counter(metric string, labels map[string]string) *prometheus.CounterVec

Counter

func (*MetricStorage) CounterAdd

func (m *MetricStorage) CounterAdd(metric string, value float64, labels map[string]string)

func (*MetricStorage) Gauge

func (m *MetricStorage) Gauge(metric string, labels map[string]string) *prometheus.GaugeVec

Gauge return saved or register a new gauge.

func (*MetricStorage) GaugeAdd

func (m *MetricStorage) GaugeAdd(metric string, value float64, labels map[string]string)

func (*MetricStorage) GaugeSet

func (m *MetricStorage) GaugeSet(metric string, value float64, labels map[string]string)

func (*MetricStorage) Handler

func (m *MetricStorage) Handler() http.Handler

func (*MetricStorage) Histogram

func (m *MetricStorage) Histogram(metric string, labels map[string]string, buckets []float64) *prometheus.HistogramVec

func (*MetricStorage) HistogramObserve

func (m *MetricStorage) HistogramObserve(metric string, value float64, labels map[string]string, buckets []float64)

Histograms

func (*MetricStorage) RegisterCounter

func (m *MetricStorage) RegisterCounter(metric string, labels map[string]string) *prometheus.CounterVec

RegisterCounter registers a counter.

func (*MetricStorage) RegisterGauge

func (m *MetricStorage) RegisterGauge(metric string, labels map[string]string) *prometheus.GaugeVec

RegisterGauge registers a gauge.

func (*MetricStorage) RegisterHistogram

func (m *MetricStorage) RegisterHistogram(metric string, labels map[string]string, buckets []float64) *prometheus.HistogramVec

func (*MetricStorage) SendBatch

func (m *MetricStorage) SendBatch(ops []operation.MetricOperation, labels map[string]string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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