Closed shu-mutou closed 4 years ago
/cc @jeefy
All the metrics that are stored in DB by the scraper are in milli (pods/nodes).
Since for CPU we do want milli and for memory we prefer raw bytes so we can transform it to Mi/Gi or whatever on our own, it seems for me that everything is fine. The results are also consistent with what kubectl top nodes/pods
shows. ~The only issue is on our side (dashboard).~
I've found also some issues on the scraper side. Some values were stripped down or changed in the wrong way.
Storing metricses in milli as follows: https://github.com/kubernetes-sigs/dashboard-metrics-scraper/blob/master/pkg/database/database.go#L42 https://github.com/kubernetes-sigs/dashboard-metrics-scraper/blob/master/pkg/database/database.go#L56
But retriving and modified in
pkg/api/dashboard/dashboard.go
as follows:metrics-server
returns cpu usage in123456780n
format, maybe in nano scale, and memory usage in4567890Ki
, so followings aims to modify these raw value, I guess. But the values seems to be stored already in milli as above. https://github.com/kubernetes-sigs/dashboard-metrics-scraper/blob/master/pkg/api/dashboard/dashboard.go#L211-L214 https://github.com/kubernetes-sigs/dashboard-metrics-scraper/blob/master/pkg/api/dashboard/dashboard.go#L243 https://github.com/kubernetes-sigs/dashboard-metrics-scraper/blob/master/pkg/api/dashboard/dashboard.go#L248I could not test these things, but I guess this might cause issue like follow. https://github.com/kubernetes/dashboard/issues/4827