vault

package
v1.4.11 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashLabelValues

func HashLabelValues(labelValues []string) uint64

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 GroupedCounterMetric struct {
	Value       uint64
	LabelValues []string
	Group       string
}

type GroupedGaugeMetric

type GroupedGaugeMetric struct {
	Value       float64
	LabelValues []string
	Group       string
}

type GroupedVault

type GroupedVault struct {
	Registerer prometheus.Registerer
	// contains filtered or unexported fields
}

func NewGroupedVault

func NewGroupedVault() *GroupedVault

func (*GroupedVault) CounterAdd

func (v *GroupedVault) CounterAdd(group string, name string, value float64, labels map[string]string)

func (*GroupedVault) ExpireGroupMetrics

func (v *GroupedVault) ExpireGroupMetrics(group string)

ClearAllMetrics takes each collector in collectors and clear all metrics by group.

func (*GroupedVault) GaugeSet

func (v *GroupedVault) GaugeSet(group string, name string, value float64, labels map[string]string)

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)

Jump to

Keyboard shortcuts

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