Merge pull request #115209 from dgrisonnet/cleanup-deprecated-metrics

Cleanup deprecated metrics
This commit is contained in:
Kubernetes Prow Robot 2023-03-13 17:51:12 -07:00 committed by GitHub
commit 781daea7b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 26 deletions

View File

@ -28,7 +28,6 @@ const (
zoneHealthStatisticKey = "zone_health"
zoneSizeKey = "zone_size"
zoneNoUnhealthyNodesKey = "unhealthy_nodes_in_zone"
evictionsNumberKey = "evictions_number"
evictionsTotalKey = "evictions_total"
updateNodeHealthKey = "update_node_health_duration_seconds"
@ -63,16 +62,6 @@ 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,
@ -111,7 +100,6 @@ func Register() {
legacyregistry.MustRegister(zoneHealth)
legacyregistry.MustRegister(zoneSize)
legacyregistry.MustRegister(unhealthyNodes)
legacyregistry.MustRegister(evictionsNumber)
legacyregistry.MustRegister(evictionsTotal)
legacyregistry.MustRegister(updateNodeHealthDuration)
legacyregistry.MustRegister(updateAllNodesHealthDuration)

View File

@ -643,9 +643,8 @@ func (nc *Controller) doNoExecuteTaintingPass(ctx context.Context) {
}
result := controllerutil.SwapNodeControllerTaint(ctx, nc.kubeClient, []*v1.Taint{&taintToAdd}, []*v1.Taint{&oppositeTaint}, node)
if result {
//count the evictionsNumber
// Count the number of evictions.
zone := nodetopology.GetZoneKey(node)
evictionsNumber.WithLabelValues(zone).Inc()
evictionsTotal.WithLabelValues(zone).Inc()
}
@ -1222,7 +1221,6 @@ func (nc *Controller) addPodEvictorForNewZone(logger klog.Logger, node *v1.Node)
flowcontrol.NewTokenBucketRateLimiter(nc.evictionLimiterQPS, scheduler.EvictionRateLimiterBurst))
// Init the metric for the new zone.
logger.Info("Initializing eviction metric for zone", "zone", zone)
evictionsNumber.WithLabelValues(zone).Add(0)
evictionsTotal.WithLabelValues(zone).Add(0)
}
}

View File

@ -66,15 +66,6 @@ var (
StabilityLevel: metrics.STABLE,
}, []string{"result", "profile"})
e2eSchedulingLatency = metrics.NewHistogramVec(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
Name: "e2e_scheduling_duration_seconds",
DeprecatedVersion: "1.23.0",
Help: "E2e scheduling latency in seconds (scheduling algorithm + binding). This metric is replaced by scheduling_attempt_duration_seconds.",
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
}, []string{"result", "profile"})
schedulingLatency = metrics.NewHistogramVec(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
@ -219,7 +210,6 @@ var (
metricsList = []metrics.Registerable{
scheduleAttempts,
e2eSchedulingLatency,
schedulingLatency,
SchedulingAlgorithmLatency,
PreemptionVictims,

View File

@ -43,7 +43,6 @@ func PodScheduleError(profile string, duration float64) {
}
func observeScheduleAttemptAndLatency(result, profile string, duration float64) {
e2eSchedulingLatency.WithLabelValues(result, profile).Observe(duration)
schedulingLatency.WithLabelValues(result, profile).Observe(duration)
scheduleAttempts.WithLabelValues(result, profile).Inc()
}