Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllServerPowerStates = []metalv1alpha1.ServerPowerState{ metalv1alpha1.ServerOnPowerState, metalv1alpha1.ServerOffPowerState, metalv1alpha1.ServerPausedPowerState, metalv1alpha1.ServerPoweringOnPowerState, metalv1alpha1.ServerPoweringOffPowerState, }
AllServerPowerStates defines all possible server power states for enum metrics
var AllServerStates = []metalv1alpha1.ServerState{ metalv1alpha1.ServerStateInitial, metalv1alpha1.ServerStateDiscovery, metalv1alpha1.ServerStateAvailable, metalv1alpha1.ServerStateReserved, metalv1alpha1.ServerStateError, metalv1alpha1.ServerStateMaintenance, }
AllServerStates defines all possible server states for enum metrics
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 ¶
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.