metrics

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

AllServerPowerStates defines all possible server power states for enum metrics

AllServerStates defines all possible server states for enum metrics

View Source
var (
	// ServerReconciliationTotal tracks reconciliation operations by result
	ServerReconciliationTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "metal_server_reconciliation_total",
			Help: "Total number of server reconciliations by result",
		},
		[]string{"result"},
	)
)

Functions

This section is empty.

Types

type ServerStateCollector

type ServerStateCollector struct {
	Client client.Client
	// contains filtered or unexported fields
}

ServerStateCollector implements prometheus.Collector to provide accurate server state counts by listing all servers on each scrape.

func NewServerStateCollector

func NewServerStateCollector(c client.Client) *ServerStateCollector

NewServerStateCollector creates a new ServerStateCollector with the given client.

func (*ServerStateCollector) Collect

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

Collect is called by Prometheus when scraping metrics. It queries all Server resources and emits enum metrics for state and power state (1 for current state, 0 for all other states), plus condition metrics.

func (*ServerStateCollector) Describe

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

Describe sends the descriptors of metrics collected by this Collector to the provided channel.

Jump to

Keyboard shortcuts

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