Documentation
¶
Index ¶
- func HashLabelValues(labelValues []string) uint64
- type ConstCounterCollector
- func (c *ConstCounterCollector) Add(group string, value float64, labels map[string]string)
- func (c *ConstCounterCollector) Collect(ch chan<- prometheus.Metric)
- func (c *ConstCounterCollector) Describe(ch chan<- *prometheus.Desc)
- func (c *ConstCounterCollector) ExpireGroupMetrics(group string)
- func (c *ConstCounterCollector) LabelNames() []string
- func (c *ConstCounterCollector) Name() string
- func (c *ConstCounterCollector) Type() string
- func (c *ConstCounterCollector) UpdateLabels(labels []string)
- type ConstGaugeCollector
- func (c *ConstGaugeCollector) Collect(ch chan<- prometheus.Metric)
- func (c *ConstGaugeCollector) Describe(ch chan<- *prometheus.Desc)
- func (c *ConstGaugeCollector) ExpireGroupMetrics(group string)
- func (c *ConstGaugeCollector) LabelNames() []string
- func (c *ConstGaugeCollector) Name() string
- func (c *ConstGaugeCollector) Set(group string, value float64, labels map[string]string)
- func (c *ConstGaugeCollector) Type() string
- func (c *ConstGaugeCollector) UpdateLabels(labels []string)
- type ConstMetricCollector
- type GroupedCounterMetric
- type GroupedGaugeMetric
- type GroupedVault
- func (v *GroupedVault) CounterAdd(group string, name string, value float64, labels map[string]string)
- func (v *GroupedVault) ExpireGroupMetrics(group string)
- func (v *GroupedVault) GaugeSet(group string, name string, value float64, labels map[string]string)
- func (v *GroupedVault) GetOrCreateCounterCollector(name string, labelNames []string) (*ConstCounterCollector, error)
- func (v *GroupedVault) GetOrCreateGaugeCollector(name string, labelNames []string) (*ConstGaugeCollector, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashLabelValues ¶
Types ¶
type ConstCounterCollector ¶
type ConstCounterCollector struct {
// contains filtered or unexported fields
}
func NewConstCounterCollector ¶
func NewConstCounterCollector(name string, labelNames []string) *ConstCounterCollector
func (*ConstCounterCollector) Add ¶
func (c *ConstCounterCollector) Add(group string, value float64, labels map[string]string)
Add increases a counter metric by a value. Metric is identified by label values and a group.
func (*ConstCounterCollector) Collect ¶
func (c *ConstCounterCollector) Collect(ch chan<- prometheus.Metric)
func (*ConstCounterCollector) Describe ¶
func (c *ConstCounterCollector) Describe(ch chan<- *prometheus.Desc)
func (*ConstCounterCollector) ExpireGroupMetrics ¶
func (c *ConstCounterCollector) ExpireGroupMetrics(group string)
ExpireGroupMetrics deletes all metrics from collection with matched group.
func (*ConstCounterCollector) LabelNames ¶
func (c *ConstCounterCollector) LabelNames() []string
func (*ConstCounterCollector) Name ¶
func (c *ConstCounterCollector) Name() string
func (*ConstCounterCollector) Type ¶
func (c *ConstCounterCollector) Type() string
func (*ConstCounterCollector) UpdateLabels ¶ added in v1.4.10
func (c *ConstCounterCollector) UpdateLabels(labels []string)
UpdateLabels checks if any new labels are provided to the controller and updates its description, labelNames list and collection. The collection is recalculated in accordance with new label list.
type ConstGaugeCollector ¶
type ConstGaugeCollector struct {
// contains filtered or unexported fields
}
func NewConstGaugeCollector ¶
func NewConstGaugeCollector(name string, labelNames []string) *ConstGaugeCollector
func (*ConstGaugeCollector) Collect ¶
func (c *ConstGaugeCollector) Collect(ch chan<- prometheus.Metric)
func (*ConstGaugeCollector) Describe ¶
func (c *ConstGaugeCollector) Describe(ch chan<- *prometheus.Desc)
func (*ConstGaugeCollector) ExpireGroupMetrics ¶
func (c *ConstGaugeCollector) ExpireGroupMetrics(group string)
ExpireGroupMetrics deletes all metrics from collection with matched group.
func (*ConstGaugeCollector) LabelNames ¶
func (c *ConstGaugeCollector) LabelNames() []string
func (*ConstGaugeCollector) Name ¶
func (c *ConstGaugeCollector) Name() string
func (*ConstGaugeCollector) Set ¶
func (c *ConstGaugeCollector) Set(group string, value float64, labels map[string]string)
func (*ConstGaugeCollector) Type ¶
func (c *ConstGaugeCollector) Type() string
func (*ConstGaugeCollector) UpdateLabels ¶ added in v1.4.10
func (c *ConstGaugeCollector) UpdateLabels(labels []string)
UpdateLabels checks if any new labels are provided to the controller and updates its description, labelNames list and collection. The collection is recalculated in accordance with new label list.
type ConstMetricCollector ¶
type ConstMetricCollector interface { Describe(ch chan<- *prometheus.Desc) Collect(ch chan<- prometheus.Metric) Type() string LabelNames() []string Name() string ExpireGroupMetrics(group string) UpdateLabels([]string) }
type GroupedCounterMetric ¶
type GroupedGaugeMetric ¶
type GroupedVault ¶
type GroupedVault struct { Registerer prometheus.Registerer // contains filtered or unexported fields }
func NewGroupedVault ¶
func NewGroupedVault() *GroupedVault
func (*GroupedVault) CounterAdd ¶
func (*GroupedVault) ExpireGroupMetrics ¶
func (v *GroupedVault) ExpireGroupMetrics(group string)
ClearAllMetrics takes each collector in collectors and clear all metrics by group.
func (*GroupedVault) GetOrCreateCounterCollector ¶
func (v *GroupedVault) GetOrCreateCounterCollector(name string, labelNames []string) (*ConstCounterCollector, error)
func (*GroupedVault) GetOrCreateGaugeCollector ¶
func (v *GroupedVault) GetOrCreateGaugeCollector(name string, labelNames []string) (*ConstGaugeCollector, error)