فهرست منبع

Emit the node_gpu_hourly_cost metric

The GaugeVec for recording node_gpu_hourly_cost is correctly initialized
but is never written to. This behavior can be observed by deploying
Kubecost and visiting /model/metrics. You will note that the
node_gpu_count metric exists but the node_gpu_hourly_cost metric does not.

This is causing GPU cost to be 0 throughout the Kubecost application,
even if GPUs are present on a Node and their count is correctly
recorded (see the Assets API).

Fixed by emitting GPU cost!
Michael Dresser 4 سال پیش
والد
کامیت
0bc8c40ab6
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      pkg/costmodel/metrics.go

+ 1 - 0
pkg/costmodel/metrics.go

@@ -472,6 +472,7 @@ func (cmme *CostModelMetricsEmitter) Start() bool {
 				}
 
 				cmme.GPUCountRecorder.WithLabelValues(nodeName, nodeName, nodeType, nodeRegion, node.ProviderID).Set(gpu)
+				cmme.GPUPriceRecorder.WithLabelValues(nodeName, nodeName, nodeType, nodeRegion, node.ProviderID).Set(gpuCost)
 
 				const outlierFactor float64 = 30
 				// don't record cpuCost, ramCost, or gpuCost in the case of wild outliers