metrics

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalRefMapping = &GlobalRefMap{}

GlobalRefMapping is used when translating to and from remote writes and the rest of the system (mostly scrapers) normal components except those should in general NOT need this.

Functions

This section is empty.

Types

type CollectorRegistry

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

CollectorRegistry is both a prometheus.Registerer and prometheus.Collector: it encapsulates a set of collectors.

Unlike a real Prometheus Registry, CollectorRegistry is unchecked and does not validate that metrics are unique at registration time.

func NewCollectorRegistry

func NewCollectorRegistry() *CollectorRegistry

NewCollectorRegistry returns a new CollectorRegistry.

func (*CollectorRegistry) Collect

func (cr *CollectorRegistry) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*CollectorRegistry) Describe

func (cr *CollectorRegistry) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

func (*CollectorRegistry) MustRegister

func (cr *CollectorRegistry) MustRegister(cs ...prometheus.Collector)

MustRegister implements prometheus.Collector.

func (*CollectorRegistry) Register

func (cr *CollectorRegistry) Register(c prometheus.Collector) error

Register implements prometheus.Collector. Unlike a real Prometheus registry, Register does not ensure that c provides unique metrics.

func (*CollectorRegistry) Unregister

func (cr *CollectorRegistry) Unregister(c prometheus.Collector) bool

Unregister implements prometheus.Collector.

type FlowMetric

type FlowMetric struct {
	GlobalRefID uint64
	Labels      labels.Labels
	Value       float64
}

FlowMetric is a wrapper around a single metric without the timestamp

type GlobalRefMap

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

GlobalRefMap allows conversion from remote_write refids to global refs ids that everything else can use

func (*GlobalRefMap) AddStaleMarker

func (g *GlobalRefMap) AddStaleMarker(globalRefID uint64, l labels.Labels)

AddStaleMarker adds a stale marker

func (*GlobalRefMap) CheckStaleMarkers

func (g *GlobalRefMap) CheckStaleMarkers()

CheckStaleMarkers is called to garbage collect and items that have grown stale over stale duration (10m)

func (*GlobalRefMap) GetGlobalRefID

func (g *GlobalRefMap) GetGlobalRefID(componentID string, localRefID uint64) uint64

GetGlobalRefID returns the global refid for a component local combo, or 0 if not found

func (*GlobalRefMap) GetLocalRefID

func (g *GlobalRefMap) GetLocalRefID(componentID string, globalRefID uint64) uint64

GetLocalRefID returns the local refid for a component global combo, or 0 if not found

func (*GlobalRefMap) GetOrAddGlobalRefID

func (g *GlobalRefMap) GetOrAddGlobalRefID(l labels.Labels) uint64

GetOrAddGlobalRefID is used to create a global refid for a labelset

func (g *GlobalRefMap) GetOrAddLink(componentID string, localRefID uint64, l labels.Labels) uint64

GetOrAddLink is called by a remote_write endpoint component to add mapping and get back the global id.

func (*GlobalRefMap) RemoveStaleMarker

func (g *GlobalRefMap) RemoveStaleMarker(globalRefID uint64)

RemoveStaleMarker removes a stale marker

type Receiver

type Receiver struct {
	// metrics should be considered immutable
	Receive func(timestamp int64, metrics []*FlowMetric) `hcl:"receiver"`
}

Receiver is used to pass an array of metrics to another receiver

Directories

Path Synopsis
nolint
nolint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳