metrics

package
v1.35.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const StatefulSetControllerSubsystem = "statefulset_controller"

Variables

View Source
var (
	// MaxUnavailable tracks the current .spec.updateStrategy.rollingUpdate.maxUnavailable value with the
	// MaxUnavailableStatefulSet feature enabled. This gauge reflects the configured maximum number of pods
	// that can be unavailable during rolling updates, providing visibility into the availability constraints.
	// The metric is set to 1 by default.
	//
	// Sample monitoring queries:
	// - Current maxUnavailable setting: statefulset_max_unavailable
	// - Compare with actual unavailable: statefulset_unavailable_replicas - statefulset_max_unavailable
	// - Alert when exceeding limit: statefulset_unavailable_replicas > statefulset_max_unavailable
	// - Monitor configuration changes: changes(statefulset_max_unavailable[1h])
	MaxUnavailable = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem:      StatefulSetControllerSubsystem,
			Name:           "statefulset_max_unavailable",
			Help:           "Maximum number of unavailable pods allowed during StatefulSet rolling updates",
			StabilityLevel: metrics.ALPHA,
		}, []string{"statefulset_namespace", "statefulset_name", "pod_management_policy"},
	)

	// UnavailableReplicas tracks the current number of unavailable pods in a StatefulSet.
	// This gauge reflects the real-time count of pods that are either missing or unavailable
	// (i.e., not ready for .spec.minReadySeconds).
	//
	// Sample monitoring queries:
	// - Current unavailable pods: statefulset_unavailable_replicas
	// - Availability percentage: (statefulset_replicas - statefulset_unavailable_replicas) / statefulset_replicas * 100
	// - Alert on high unavailability: statefulset_unavailable_replicas > statefulset_max_unavailable
	// - Monitor availability trends: statefulset_unavailable_replicas
	UnavailableReplicas = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem:      StatefulSetControllerSubsystem,
			Name:           "statefulset_unavailable_replicas",
			Help:           "Current number of unavailable pods in StatefulSet",
			StabilityLevel: metrics.ALPHA,
		}, []string{"statefulset_namespace", "statefulset_name", "pod_management_policy"},
	)
)

Functions

func Register

func Register()

Types

This section is empty.

Jump to

Keyboard shortcuts

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