package metrics
import "k8s.io/kubernetes/pkg/controller/statefulset/metrics"
Index ¶
Constants ¶
const StatefulSetControllerSubsystem = "statefulset_controller"
Variables ¶
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]) = 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 = 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"}, ) // StatefulSetRequeueSkips tracks the number of StatefulSet syncs skipped due to a stale watch cache. StatefulSetRequeueSkips = metrics.NewCounterVec( &metrics.CounterOpts{ Subsystem: StatefulSetControllerSubsystem, Name: "stale_sync_skips_total", Help: "Total number of StatefulSet syncs skipped due to a stale watch cache.", StabilityLevel: metrics.ALPHA, }, []string{"group", "resource"}, ) )
Functions ¶
func Register ¶
func Register()
Source Files ¶
metrics.go
- Version
- v1.36.0 (latest)
- Published
- Apr 22, 2026
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 46 seconds ago –
Tools for package owners.