Documentation ¶
Index ¶
- Constants
- type MetricStorage
- func (m *MetricStorage) ApplyOperation(op operation.MetricOperation, commonLabels map[string]string)
- func (m *MetricStorage) Counter(metric string, labels map[string]string) *prometheus.CounterVec
- func (m *MetricStorage) CounterAdd(metric string, value float64, labels map[string]string)
- func (m *MetricStorage) Gauge(metric string, labels map[string]string) *prometheus.GaugeVec
- func (m *MetricStorage) GaugeAdd(metric string, value float64, labels map[string]string)
- func (m *MetricStorage) GaugeSet(metric string, value float64, labels map[string]string)
- func (m *MetricStorage) Handler() http.Handler
- func (m *MetricStorage) Histogram(metric string, labels map[string]string, buckets []float64) *prometheus.HistogramVec
- func (m *MetricStorage) HistogramObserve(metric string, value float64, labels map[string]string, buckets []float64)
- func (m *MetricStorage) RegisterCounter(metric string, labels map[string]string) *prometheus.CounterVec
- func (m *MetricStorage) RegisterGauge(metric string, labels map[string]string) *prometheus.GaugeVec
- func (m *MetricStorage) RegisterHistogram(metric string, labels map[string]string, buckets []float64) *prometheus.HistogramVec
- func (m *MetricStorage) SendBatch(ops []operation.MetricOperation, labels map[string]string) error
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
Click to show internal directories.
Click to hide internal directories.