metrics

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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