metrics

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCheckBuckets

func GenerateCheckBuckets(timeout time.Duration) []float64

GenerateCheckBuckets computes histogram buckets for check durations based on the check timeout. Buckets cover 0 to timeout with linear spacing, plus exponential subdivisions near zero for fine-grained latency visibility. A small overrun bucket beyond nominal timeout captures scheduling jitter.

Types

type Metrics

type Metrics struct {
	Registry *prometheus.Registry

	// VIP state: 0=withdrawn, 1=announced, 2=pessimized
	VIPState *prometheus.GaugeVec
	// VIP transitions counter
	VIPTransitions *prometheus.CounterVec
	// VIP last transition timestamp
	VIPLastTransition *prometheus.GaugeVec
	// VIP priority status (AS-path multiplier: 1=normal, N=prepend count)
	VIPPriority *prometheus.GaugeVec

	// Route state: per-peer per-VIP (1=advertised, 0=withdrawn)
	RouteState *prometheus.GaugeVec

	// Check counters by result (success/fail/stale)
	CheckTotal *prometheus.CounterVec
	// Checks absorbed by rise/fall (did not trigger state change)
	CheckAbsorbed *prometheus.CounterVec
	// Check duration histogram
	CheckDuration *prometheus.HistogramVec
	// Check last result (0=fail, 1=ok)
	CheckLastResult *prometheus.GaugeVec
	// Check timeout exceeded
	CheckTimeoutExceeded *prometheus.CounterVec
}

Metrics holds all pathosd-specific Prometheus metrics.

func New

func New(checkBuckets []float64) *Metrics

New creates a new Metrics instance with all collectors registered. checkBuckets are the histogram bucket boundaries for check duration; pass nil to skip histogram creation.

Jump to

Keyboard shortcuts

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