mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #106366 from cyclinder/evictions_number_stable
adding evictions_total metric and marking evictions_number deprecated
This commit is contained in:
commit
ba200841fd
@ -29,6 +29,7 @@ const (
|
||||
zoneSizeKey = "zone_size"
|
||||
zoneNoUnhealthyNodesKey = "unhealthy_nodes_in_zone"
|
||||
evictionsNumberKey = "evictions_number"
|
||||
evictionsTotalKey = "evictions_total"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -60,11 +61,21 @@ var (
|
||||
[]string{"zone"},
|
||||
)
|
||||
evictionsNumber = metrics.NewCounterVec(
|
||||
&metrics.CounterOpts{
|
||||
Subsystem: nodeControllerSubsystem,
|
||||
Name: evictionsNumberKey,
|
||||
Help: "Number of Node evictions that happened since current instance of NodeController started, This metric is replaced by node_collector_evictions_total.",
|
||||
DeprecatedVersion: "1.24.0",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
},
|
||||
[]string{"zone"},
|
||||
)
|
||||
evictionsTotal = metrics.NewCounterVec(
|
||||
&metrics.CounterOpts{
|
||||
Subsystem: nodeControllerSubsystem,
|
||||
Name: evictionsNumberKey,
|
||||
Name: evictionsTotalKey,
|
||||
Help: "Number of Node evictions that happened since current instance of NodeController started.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
StabilityLevel: metrics.STABLE,
|
||||
},
|
||||
[]string{"zone"},
|
||||
)
|
||||
@ -79,5 +90,6 @@ func Register() {
|
||||
legacyregistry.MustRegister(zoneSize)
|
||||
legacyregistry.MustRegister(unhealthyNodes)
|
||||
legacyregistry.MustRegister(evictionsNumber)
|
||||
legacyregistry.MustRegister(evictionsTotal)
|
||||
})
|
||||
}
|
||||
|
@ -699,6 +699,7 @@ func (nc *Controller) doNoExecuteTaintingPass(ctx context.Context) {
|
||||
//count the evictionsNumber
|
||||
zone := nodetopology.GetZoneKey(node)
|
||||
evictionsNumber.WithLabelValues(zone).Inc()
|
||||
evictionsTotal.WithLabelValues(zone).Inc()
|
||||
}
|
||||
|
||||
return result, 0
|
||||
@ -742,6 +743,7 @@ func (nc *Controller) doEvictionPass(ctx context.Context) {
|
||||
if node != nil {
|
||||
zone := nodetopology.GetZoneKey(node)
|
||||
evictionsNumber.WithLabelValues(zone).Inc()
|
||||
evictionsTotal.WithLabelValues(zone).Inc()
|
||||
}
|
||||
|
||||
return true, 0
|
||||
@ -1396,6 +1398,7 @@ func (nc *Controller) addPodEvictorForNewZone(node *v1.Node) {
|
||||
// Init the metric for the new zone.
|
||||
klog.Infof("Initializing eviction metric for zone: %v", zone)
|
||||
evictionsNumber.WithLabelValues(zone).Add(0)
|
||||
evictionsTotal.WithLabelValues(zone).Add(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
- name: evictions_total
|
||||
subsystem: node_collector
|
||||
help: Number of Node evictions that happened since current instance of NodeController
|
||||
started.
|
||||
type: Counter
|
||||
stabilityLevel: STABLE
|
||||
labels:
|
||||
- zone
|
||||
- name: framework_extension_point_duration_seconds
|
||||
subsystem: scheduler
|
||||
help: Latency for running all plugins of a specific extension point.
|
||||
|
Loading…
Reference in New Issue
Block a user