Repository: kubernetes/kubernetes (language: go)

Issue:
scheduler: removed the deprecated metric scheduler_cache_size in v1.34
scheduler: removed the deprecated metric scheduler_scheduler_cache_size in v1.34

more detail: https://github.com/kubernetes/kubernetes/pull/128810#discussion_r1851486291



Discussion / hints:
This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the `triage/accepted` label and provide further guidance.

The `triage/accepted` label can be added by org members by writing `/triage accepted` in a comment.


<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
</details>
/kind cleanup
/sig scheduling
/assign
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue as fresh with `/remove-lifecycle stale`
- Close this issue with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle stale

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-lifecycle stale

Fix patch:
diff --git a/pkg/scheduler/backend/cache/cache.go b/pkg/scheduler/backend/cache/cache.go
index 97d54011051f3..9973644811583 100644
--- a/pkg/scheduler/backend/cache/cache.go
+++ b/pkg/scheduler/backend/cache/cache.go
@@ -757,12 +757,4 @@ func (cache *cacheImpl) updateMetrics() {
 	metrics.CacheSize.WithLabelValues("assumed_pods").Set(float64(len(cache.assumedPods)))
 	metrics.CacheSize.WithLabelValues("pods").Set(float64(len(cache.podStates)))
 	metrics.CacheSize.WithLabelValues("nodes").Set(float64(len(cache.nodes)))
-
-	// we intentionally keep them with the deprecation and will remove at v1.34.
-	//nolint:staticcheck
-	metrics.SchedulerCacheSize.WithLabelValues("assumed_pods").Set(float64(len(cache.assumedPods)))
-	//nolint:staticcheck
-	metrics.SchedulerCacheSize.WithLabelValues("pods").Set(float64(len(cache.podStates)))
-	//nolint:staticcheck
-	metrics.SchedulerCacheSize.WithLabelValues("nodes").Set(float64(len(cache.nodes)))
 }
diff --git a/pkg/scheduler/metrics/metrics.go b/pkg/scheduler/metrics/metrics.go
index 3d0edacd9541b..e993fff5e9e6d 100644
--- a/pkg/scheduler/metrics/metrics.go
+++ b/pkg/scheduler/metrics/metrics.go
@@ -107,11 +107,8 @@ var (
 	FrameworkExtensionPointDuration *metrics.HistogramVec
 	PluginExecutionDuration         *metrics.HistogramVec
 
-	PermitWaitDuration *metrics.HistogramVec
-	CacheSize          *metrics.GaugeVec
-	// Deprecated: SchedulerCacheSize is deprecated,
-	// and will be removed at v1.34. Please use CacheSize instead.
-	SchedulerCacheSize    *metrics.GaugeVec
+	PermitWaitDuration    *metrics.HistogramVec
+	CacheSize             *metrics.GaugeVec
 	unschedulableReasons  *metrics.GaugeVec
 	PluginEvaluationTotal *metrics.CounterVec
 
@@ -294,15 +291,6 @@ func InitMetrics() {
 		},
 		[]string{"result"})
 
-	SchedulerCacheSize = metrics.NewGaugeVec(
-		&metrics.GaugeOpts{
-			Subsystem:         SchedulerSubsystem,
-			Name:              "scheduler_cache_size",
-			Help:              "Number of nodes, pods, and assumed (bound) pods in the scheduler cache.",
-			StabilityLevel:    metrics.ALPHA,
-			DeprecatedVersion: "1.33.0",
-		}, []string{"type"})
-
 	CacheSize = metrics.NewGaugeVec(
 		&metrics.GaugeOpts{
 			Subsystem:      SchedulerSubsystem,
@@ -362,7 +350,6 @@ func InitMetrics() {
 		Goroutines,
 		PermitWaitDuration,
 		CacheSize,
-		SchedulerCacheSize,
 		unschedulableReasons,
 		PluginEvaluationTotal,
 	}


Test patch: