kubernetes-sigs / dashboard-metrics-scraper

Container to scrape, store, and retrieve a window of time from the Metrics Server.
Apache License 2.0
87 stars 39 forks source link

Store metricses in milli, but does not seem to be retrieved in milli #24

Closed shu-mutou closed 4 years ago

shu-mutou commented 4 years ago

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:

I could not test these things, but I guess this might cause issue like follow. https://github.com/kubernetes/dashboard/issues/4827

shu-mutou commented 4 years ago

/cc @jeefy

floreks commented 4 years ago

All the metrics that are stored in DB by the scraper are in milli (pods/nodes).

https://github.com/kubernetes-sigs/dashboard-metrics-scraper/blob/master/pkg/database/database.go#L42

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.