vault

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstMetricCollector

type ConstMetricCollector interface {
	Describe(chan<- *prometheus.Desc)
	Collect(chan<- prometheus.Metric)
	Store(time.Time, Sample)
	Clear(time.Time)
}

type GaugeCollector

type GaugeCollector struct {
	// contains filtered or unexported fields
}

func NewConstGaugeCollector

func NewConstGaugeCollector(mapping Mapping) *GaugeCollector

func (*GaugeCollector) Clear

func (c *GaugeCollector) Clear(now time.Time)

func (*GaugeCollector) Collect

func (c *GaugeCollector) Collect(ch chan<- prometheus.Metric)

func (*GaugeCollector) Describe

func (c *GaugeCollector) Describe(ch chan<- *prometheus.Desc)

func (*GaugeCollector) Store

func (c *GaugeCollector) Store(timestamp time.Time, sample Sample)

type Mapping

type Mapping struct {
	Name string `yaml:"name"`
	Help string `yaml:"help,omitempty"`

	LabelNames []string      `yaml:"labels,omitempty"`
	TTL        time.Duration `yaml:"ttl,omitempty"`
}

type MetricsVault

type MetricsVault struct {
	// contains filtered or unexported fields
}

func NewVault

func NewVault() *MetricsVault

func (*MetricsVault) RegisterMappings

func (v *MetricsVault) RegisterMappings(mappings []Mapping) error

func (*MetricsVault) RemoveStaleMetrics

func (v *MetricsVault) RemoveStaleMetrics()

func (*MetricsVault) Store

func (v *MetricsVault) Store(index string, sample Sample) error

type Sample

type Sample struct {
	// ID is a sample unique id e.g., labels hash, uuid.
	ID string
	// Labels are label values in determined order.
	Labels []string
	// Value is a sample latest sample value.
	Value float64
	// Timestamp is the time sample was collected.
	// Events exporter will collect the expired sample basing on this field.
	Timestamp time.Time
}

type StampedGaugeMetric

type StampedGaugeMetric struct {
	Value float64

	LabelValues []string
	LastUpdate  time.Time
}

Jump to

Keyboard shortcuts

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