Skip to content

Commit e0f63c1

Browse files
authored
Merge pull request kubernetes#3211 from kgolab/vpa-metrics-fix-log2
Fix use of log2 label value
2 parents 527c433 + 632a942 commit e0f63c1

File tree

1 file changed

+2
-1
lines changed
  • vertical-pod-autoscaler/pkg/utils/metrics/quality

1 file changed

+2
-1
lines changed

vertical-pod-autoscaler/pkg/utils/metrics/quality/quality.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ func ObserveRecommendationChange(previous, current corev1.ResourceList, updateMo
214214

215215
if oldValue > 0.0 {
216216
diff := newValue/oldValue - 1.0 // -1.0 to report decreases as negative values and keep 0.0 neutral
217-
relativeRecommendationChange.WithLabelValues(updateModeToString(updateMode), string(resource), string(vpaSize)).Observe(diff)
217+
log2 := metrics.GetVpaSizeLog2(vpaSize)
218+
relativeRecommendationChange.WithLabelValues(updateModeToString(updateMode), string(resource), strconv.Itoa(log2)).Observe(diff)
218219
} else {
219220
klog.Warningf("Cannot compare as old recommendation for %v is 0. VPA mode: %v, size: %v", resource, updateMode, vpaSize)
220221
}

0 commit comments

Comments
 (0)