Skip to content

Commit

Permalink
fix: use proposed_memory_request for recording memory request (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho authored Oct 3, 2023
1 parent abbc3e5 commit 885061e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ var (

ProposedCPURequest = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "proposed_cpu_request",
Help: "recommended resource request that tortoises propose",
Help: "recommended cpu request (millicore) that tortoises propose",
}, []string{"tortoise_name", "namespace", "container_name"})

ProposedMemoryRequest = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "proposed_memory_request",
Help: "recommended resource request that tortoises propose",
Help: "recommended memory request (millibyte) that tortoises propose",
}, []string{"tortoise_name", "namespace", "container_name"})
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/vpa/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (c *Service) UpdateVPAFromTortoiseRecommendation(ctx context.Context, torto
metrics.ProposedCPURequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName).Set(float64(value.MilliValue()))
}
if resourcename == corev1.ResourceMemory {
metrics.ProposedCPURequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName).Set(float64(value.MilliValue()))
metrics.ProposedMemoryRequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName).Set(float64(value.MilliValue()))
}
}
metricsRecorded = true
Expand Down

0 comments on commit 885061e

Please sign in to comment.