Documentation
¶
Overview ¶
Package metrics provides Prometheus metrics collection for the unikernel engine daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collectors ¶
type Collectors struct {
// VM states gauge
VMCreated prometheus.Gauge
VMStarting prometheus.Gauge
VMRunning prometheus.Gauge
VMStopping prometheus.Gauge
VMStopped prometheus.Gauge
// VM lifecycle counters
VMStartsTotal prometheus.Counter
VMStopsTotal prometheus.Counter
VMRestartsTotal prometheus.Counter
VMErrorsTotal prometheus.Counter
// Build info
BuildInfo *prometheus.GaugeVec
// Registry counts
ImagesTotal prometheus.Gauge
PushTotal prometheus.Counter
PullTotal prometheus.Counter
PushErrorsTotal prometheus.Counter
PullErrorsTotal prometheus.Counter
// Network
PortForwardsActive prometheus.Gauge
BridgeCount prometheus.Gauge
// Up
StartTime prometheus.Gauge
// contains filtered or unexported fields
}
Collectors holds all Prometheus metric collectors for the daemon.
func NewCollectors ¶
func NewCollectors(version string) *Collectors
NewCollectors creates and registers all Prometheus metric collectors.
func (*Collectors) Handler ¶
func (c *Collectors) Handler() http.Handler
Handler returns an http.Handler that serves Prometheus metrics.
type VMStateCounts ¶
type VMStateCounts struct {
Created atomic.Int64
Starting atomic.Int64
Running atomic.Int64
Stopping atomic.Int64
Stopped atomic.Int64
}
VMStateCounts tracks the number of VMs in each state.
type VMStateUpdater ¶
type VMStateUpdater struct {
// contains filtered or unexported fields
}
VMStateUpdater periodically polls a vm.Manager and updates Prometheus gauges with the current count of VMs in each state.
func NewVMStateUpdater ¶
func NewVMStateUpdater(collectors *Collectors, mgr vm.Manager, interval time.Duration) *VMStateUpdater
NewVMStateUpdater creates an updater that polls the manager at the given interval.
func (*VMStateUpdater) Run ¶
func (u *VMStateUpdater) Run(ctx context.Context)
Run starts the polling loop. It blocks until ctx is canceled.
Click to show internal directories.
Click to hide internal directories.