metrics

package
v0.0.0-...-a4e75fc Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller[T coreapi.CosmosPersistable] struct {
	// contains filtered or unexported fields
}

Controller watches a SharedIndexInformer and keeps metrics level-driven from the current cache contents.

func NewController

func NewController[T coreapi.CosmosPersistable](
	name string,
	informer cache.SharedIndexInformer,
	handler Handler[T],
) *Controller[T]

NewController creates a metrics controller for the given informer/handler pair.

func (*Controller[T]) Run

func (c *Controller[T]) Run(ctx context.Context, threadiness int)

Run starts the controller workers and blocks until ctx is cancelled.

type Handler

type Handler[T coreapi.CosmosPersistable] interface {
	Sync(ctx context.Context, obj T)
	Delete(key string)
}

Handler emits and deletes Prometheus metrics for a single Cosmos-backed type.

func NewClusterInfoMetricsHandler

func NewClusterInfoMetricsHandler(registerer prometheus.Registerer) Handler[*coreapi.ServiceProviderCluster]

NewClusterInfoMetricsHandler creates a metrics handler that emits a backend_cluster_info gauge for each cluster, labeled with its management cluster placement. Use PromQL joins to combine with other per-cluster metrics.

func NewClusterMetricsHandler

func NewClusterMetricsHandler(r prometheus.Registerer) Handler[*coreapi.HCPOpenShiftCluster]

NewClusterMetricsHandler creates a metrics handler for cluster metrics.

func NewClusterVersionMetricsHandler

func NewClusterVersionMetricsHandler(
	prometheusRegisterer prometheus.Registerer,
	readDesireLister kubeapplierlisters.ReadDesireLister,
) Handler[*coreapi.ServiceProviderCluster]

NewClusterVersionMetricsHandler creates a metrics handler for cluster version metrics.

func NewExternalAuthMetricsHandler

func NewExternalAuthMetricsHandler(r prometheus.Registerer) Handler[*coreapi.HCPOpenShiftClusterExternalAuth]

NewExternalAuthMetricsHandler creates a metrics handler for external auth metrics.

func NewNodePoolMetricsHandler

func NewNodePoolMetricsHandler(r prometheus.Registerer) Handler[*coreapi.HCPOpenShiftClusterNodePool]

NewNodePoolMetricsHandler creates a metrics handler for node pool metrics.

func NewOperationPhaseMetricsHandler

func NewOperationPhaseMetricsHandler(r prometheus.Registerer) Handler[*coreapi.Operation]

NewOperationPhaseMetricsHandler creates a metrics handler for operation metrics.

Jump to

Keyboard shortcuts

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