Use Delete() instead of DeleteLabelValues() for etcd metrics

Kubernetes-commit: 2629fe25faa73837201dcfc7c4de039112ca125f
This commit is contained in:
Richa Banker 2025-08-06 21:24:27 -07:00 committed by Kubernetes Publisher
parent 8f1beab7b2
commit df8dfa69e6
1 changed files with 2 additions and 2 deletions

View File

@ -224,8 +224,8 @@ func UpdateStoreStats(groupResource schema.GroupResource, stats storage.Stats, e
// DeleteStoreStats delete the stats metrics.
func DeleteStoreStats(groupResource schema.GroupResource) {
objectCounts.DeleteLabelValues(groupResource.String())
newObjectCounts.DeleteLabelValues(groupResource.Group, groupResource.Resource)
objectCounts.Delete(map[string]string{"resource": groupResource.String()})
newObjectCounts.Delete(map[string]string{"group": groupResource.Group, "resource": groupResource.Resource})
if utilfeature.DefaultFeatureGate.Enabled(features.SizeBasedListCostEstimate) {
resourceSizeEstimate.DeleteLabelValues(groupResource.Group, groupResource.Resource)
}