metrics

package
v1.20.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const LabelTargetNodeName = "target_node"

Variables

This section is empty.

Functions

func SinceInSeconds

func SinceInSeconds(start time.Time) float64

SinceInSeconds returns the time elapsed since start in seconds.

Types

type Metrics

type Metrics struct {
	// Per-node IP metrics
	AvailableIPs metric.DeletableVec[metric.Gauge]
	UsedIPs      metric.DeletableVec[metric.Gauge]
	NeededIPs    metric.DeletableVec[metric.Gauge]

	// IP and interface allocation counters
	AllocateIpOps        metric.Vec[metric.Counter]
	ReleaseIpOps         metric.Vec[metric.Counter]
	AllocateInterfaceOps metric.Vec[metric.Counter]

	// Interface availability
	InterfaceCandidates   metric.Gauge
	EmptyInterfaceSlots   metric.Gauge
	AvailableIPsPerSubnet metric.Vec[metric.Gauge]

	// Node category counts
	Nodes metric.Vec[metric.Gauge]

	// Resync counter
	ResyncTotal metric.Counter

	// Allocation/release latency histograms
	Allocation             metric.Vec[metric.Observer]
	Release                metric.Vec[metric.Observer]
	BackgroundSyncDuration metric.Vec[metric.Observer]

	// Trigger metrics
	// pool_maintainer is a more generic name, but for backward compatibility
	// of dashboard, keep the metric name deficit_resolver unchanged
	PoolMaintainerQueued       metric.Counter
	PoolMaintainerFolds        metric.Gauge
	PoolMaintainerCallDuration metric.Histogram
	PoolMaintainerLatency      metric.Histogram

	// Trigger metrics – k8s sync
	K8sSyncQueued       metric.Counter
	K8sSyncFolds        metric.Gauge
	K8sSyncCallDuration metric.Histogram
	K8sSyncLatency      metric.Histogram

	// Trigger metrics – resync
	ResyncQueued       metric.Counter
	ResyncFolds        metric.Gauge
	ResyncCallDuration metric.Histogram
	ResyncLatency      metric.Histogram
}

Metrics holds all Prometheus metrics for the IPAM node manager.

func NewMetrics

func NewMetrics() *Metrics

NewMetrics returns a new interface metrics implementation.

func (*Metrics) AddIPAllocation

func (m *Metrics) AddIPAllocation(subnetID string, allocated int64)

func (*Metrics) AddIPRelease

func (m *Metrics) AddIPRelease(subnetID string, released int64)

func (*Metrics) AllocationAttempt

func (m *Metrics) AllocationAttempt(typ, status, subnetID string, observe float64)

func (*Metrics) DeleteNode

func (m *Metrics) DeleteNode(node string)

DeleteNode removes all per-node metrics for the given node.

func (*Metrics) IncInterfaceAllocation

func (m *Metrics) IncInterfaceAllocation(subnetID string)

func (*Metrics) IncResyncCount

func (m *Metrics) IncResyncCount()

func (*Metrics) K8sSyncTrigger

func (m *Metrics) K8sSyncTrigger() trigger.MetricsObserver

func (*Metrics) ObserveBackgroundSync

func (m *Metrics) ObserveBackgroundSync(status string, duration time.Duration)

func (*Metrics) PoolMaintainerTrigger

func (m *Metrics) PoolMaintainerTrigger() trigger.MetricsObserver

func (*Metrics) ReleaseAttempt

func (m *Metrics) ReleaseAttempt(typ, status, subnetID string, observe float64)

func (*Metrics) ResyncTrigger

func (m *Metrics) ResyncTrigger() trigger.MetricsObserver

func (*Metrics) SetAvailableIPsPerSubnet

func (m *Metrics) SetAvailableIPsPerSubnet(subnetID string, availabilityZone string, available int)

func (*Metrics) SetEmptyInterfaceSlots

func (m *Metrics) SetEmptyInterfaceSlots(emptyInterfaceSlots int)

func (*Metrics) SetIPAvailable

func (m *Metrics) SetIPAvailable(node string, cap int)

func (*Metrics) SetIPNeeded

func (m *Metrics) SetIPNeeded(node string, usage int)

func (*Metrics) SetIPUsed

func (m *Metrics) SetIPUsed(node string, usage int)

func (*Metrics) SetInterfaceCandidates

func (m *Metrics) SetInterfaceCandidates(interfaceCandidates int)

func (*Metrics) SetNodes

func (m *Metrics) SetNodes(label string, nodes int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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