metrics

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FleetCollector added in v0.36.0

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

FleetCollector reports the shape of the fleet at scrape time: vms by state and host, each host's capacity and allocation, and snapshots by state and mode. it reads live state on every scrape instead of keeping gauges, so a host or state that goes away simply stops being reported.

func NewFleetCollector added in v0.36.0

func NewFleetCollector(src FleetSource) *FleetCollector

NewFleetCollector returns a collector over src. register it once.

func (*FleetCollector) Collect added in v0.36.0

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

Collect implements prometheus.Collector.

func (*FleetCollector) Describe added in v0.36.0

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

Describe implements prometheus.Collector.

type FleetSource added in v0.36.0

type FleetSource interface {
	ListFleet() []orchestrator.VMInfo
	ListHosts() []orchestrator.Host
	SnapshotCounts(ctx context.Context) (map[orchestrator.SnapshotCountKey]int, error)
}

FleetSource is the part of the fleet manager the collector reads.

type PrometheusMetrics

type PrometheusMetrics struct {

	// HTTP handler metrics (used by the middleware).
	HTTPRequestsTotal    *prometheus.CounterVec
	HTTPRequestDuration  *prometheus.HistogramVec
	HTTPRequestsInFlight prometheus.Gauge
	// contains filtered or unexported fields
}

PrometheusMetrics implements orchestrator.ReconcileMetrics using Prometheus counters, gauges, and histograms. It also exposes VM lifecycle gauges that are updated each reconcile cycle.

func NewPrometheusMetrics

func NewPrometheusMetrics(reg prometheus.Registerer) *PrometheusMetrics

NewPrometheusMetrics creates and registers all orchestrator metrics on the given registry. Pass prometheus.DefaultRegisterer for the global registry, or a custom one for tests.

func (*PrometheusMetrics) EgressProvisionFailed added in v0.31.0

func (m *PrometheusMetrics) EgressProvisionFailed(provider string)

EgressProvisionFailed implements orchestrator.EgressMetrics.

func (*PrometheusMetrics) EgressTeardownFailed added in v0.31.0

func (m *PrometheusMetrics) EgressTeardownFailed(provider string)

EgressTeardownFailed implements orchestrator.EgressMetrics.

func (*PrometheusMetrics) OperationCompleted added in v0.36.0

func (m *PrometheusMetrics) OperationCompleted(op string, d time.Duration, err error)

OperationCompleted implements orchestrator.OperationMetrics.

func (*PrometheusMetrics) ReconcileCompleted

func (m *PrometheusMetrics) ReconcileCompleted(s orchestrator.ReconcileSummary)

ReconcileCompleted implements the orchestrator.ReconcileMetrics interface. Called at the end of each reconcile cycle with a summary of what happened.

Jump to

Keyboard shortcuts

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