prometheus

package
v0.0.0-...-f0fa1af Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 9 Imported by: 8 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Prometheus common library webdevops projects

Collector

Caching

Prometheus collector offers a caching mechanism for faster restart with different backends defined by the cache spec:

Cache spec Description
file://path/to/cache/ Use local filesystem to cache data (use PVC inside Kubernetes!)
azblob://{storageAccountName}.blob.core.windows.net/{containerName}/{optionalPath} Use Azure StorageAccount to save cache data (with optional sub path)
k8scm://{namespace}/{configMapName} Use Kubernetes ConfigMap to save cache data

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashedMetricList

type HashedMetricList struct {
	List map[string]*MetricRow `json:"list"`
	// contains filtered or unexported fields
}

func NewHashedMetricsList

func NewHashedMetricsList() *HashedMetricList

func (*HashedMetricList) CounterAdd

func (m *HashedMetricList) CounterAdd(counter *prometheus.CounterVec)

func (*HashedMetricList) GaugeSet

func (m *HashedMetricList) GaugeSet(gauge *prometheus.GaugeVec)

func (*HashedMetricList) GetList

func (m *HashedMetricList) GetList() []MetricRow

func (*HashedMetricList) Inc

func (m *HashedMetricList) Inc(labels prometheus.Labels)

func (*HashedMetricList) Init

func (m *HashedMetricList) Init()

func (*HashedMetricList) LoadFromCache

func (m *HashedMetricList) LoadFromCache(key string) bool

func (*HashedMetricList) Reset

func (m *HashedMetricList) Reset()

func (*HashedMetricList) SetCache

func (m *HashedMetricList) SetCache(instance *cache.Cache)

func (*HashedMetricList) StoreToCache

func (m *HashedMetricList) StoreToCache(key string, duration time.Duration) error

type MetricList

type MetricList struct {
	List []MetricRow `json:"list"`
	// contains filtered or unexported fields
}

func NewMetricsList

func NewMetricsList() *MetricList

func (*MetricList) Add

func (m *MetricList) Add(labels prometheus.Labels, value float64)

func (*MetricList) AddBool

func (m *MetricList) AddBool(labels prometheus.Labels, state bool)

func (*MetricList) AddDuration

func (m *MetricList) AddDuration(labels prometheus.Labels, value time.Duration)

func (*MetricList) AddIfGreaterZero

func (m *MetricList) AddIfGreaterZero(labels prometheus.Labels, value float64)

func (*MetricList) AddIfNotNil

func (m *MetricList) AddIfNotNil(labels prometheus.Labels, value *float64)

func (*MetricList) AddIfNotZero

func (m *MetricList) AddIfNotZero(labels prometheus.Labels, value float64)

func (*MetricList) AddInfo

func (m *MetricList) AddInfo(labels prometheus.Labels)

func (*MetricList) AddTime

func (m *MetricList) AddTime(labels prometheus.Labels, value time.Time)

func (*MetricList) CounterAdd

func (m *MetricList) CounterAdd(counter *prometheus.CounterVec)

func (*MetricList) GaugeSet

func (m *MetricList) GaugeSet(gauge *prometheus.GaugeVec)

func (*MetricList) GaugeSetInc

func (m *MetricList) GaugeSetInc(gauge *prometheus.GaugeVec)

func (*MetricList) GetList

func (m *MetricList) GetList() []MetricRow

func (*MetricList) HistogramSet

func (m *MetricList) HistogramSet(histogram *prometheus.HistogramVec)

func (*MetricList) Init

func (m *MetricList) Init()

func (*MetricList) LoadFromCache

func (m *MetricList) LoadFromCache(key string) bool

func (*MetricList) Reset

func (m *MetricList) Reset()

func (*MetricList) SetCache

func (m *MetricList) SetCache(instance *cache.Cache)

func (*MetricList) StoreToCache

func (m *MetricList) StoreToCache(key string, duration time.Duration) error

func (*MetricList) SummarySet

func (m *MetricList) SummarySet(summary *prometheus.SummaryVec)

type MetricRow

type MetricRow struct {
	Labels prometheus.Labels `json:"labels"`
	Value  float64           `json:"value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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