From b5681959c080290846983e10d346219db0bc1c2c Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Tue, 3 Oct 2023 16:01:23 +0900 Subject: [PATCH] fix: proposed_memory_request to byte --- pkg/metrics/metrics.go | 2 +- pkg/vpa/service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index 359453d0..611b8629 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -28,7 +28,7 @@ var ( ProposedMemoryRequest = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "proposed_memory_request", - Help: "recommended memory request (millibyte) that tortoises propose", + Help: "recommended memory request (byte) that tortoises propose", }, []string{"tortoise_name", "namespace", "container_name", "controller_name", "controller_kind"}) ) diff --git a/pkg/vpa/service.go b/pkg/vpa/service.go index e5488971..24f65ef6 100644 --- a/pkg/vpa/service.go +++ b/pkg/vpa/service.go @@ -212,7 +212,7 @@ func (c *Service) UpdateVPAFromTortoiseRecommendation(ctx context.Context, torto metrics.ProposedCPURequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName, tortoise.Spec.TargetRefs.DeploymentName, "Deployment").Set(float64(value.MilliValue())) } if resourcename == corev1.ResourceMemory { - metrics.ProposedMemoryRequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName, tortoise.Spec.TargetRefs.DeploymentName, "Deployment").Set(float64(value.MilliValue())) + metrics.ProposedMemoryRequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName, tortoise.Spec.TargetRefs.DeploymentName, "Deployment").Set(float64(value.Value())) } } metricsRecorded = true