What would you like to be added:
Support realtime CPU/RAM metrics without prometheus needing to be installed, by querying the Kubernetes metrics APIs for nodes/pods where kube-metrics-server is installed
Why is this needed:
Our clusters do not run prometheus, yet this information is still available in an alternative format.
Environment you are Lens application on:
Long time ago (when Lens was still closed source and was running in-cluster) we did pull all the metrics data from metrics-server. Reason why we switched to prometheus was time series data (metrics-server only stores the last value). Do you have already have an idea how Lens could use metrics-server for time series? Local cache?
There are some pages where only the last value is used (getLastMetricValues), e.g. I was thinking it'd be useful to show the last value of CPU/memory usage when listing pods/nodes, or as a fallback if timeseries data from prometheus isn't available.
I also started experimenting on a branch with running Prometheus locally, but that has a problem - that that will require a tunnel to access the metrics endpoint of every pod/node in the cluster, which doesn't actually help our internal use case where engineers only have access to the API and not to run the port-forward command.
I would love to see this implemented. Time series metrics are nice, and I understand the necessity of something like Prometheus for that, however for the occasions when you just want to see local CPU, RAM, and disk usage in real time, the k8s metrics APIs seems like they would be perfect for that. As @adammw points out, when looking at a list of pods, nodes, etc., you only care about the instantaneous metrics values. This is one of the main reasons I keep going back to k9s.
I have to agree we use some other TSDB for our metrics but it would be a great way yo have metric-server included as an options for current info
Most helpful comment
There are some pages where only the last value is used (
getLastMetricValues), e.g. I was thinking it'd be useful to show the last value of CPU/memory usage when listing pods/nodes, or as a fallback if timeseries data from prometheus isn't available.I also started experimenting on a branch with running Prometheus locally, but that has a problem - that that will require a tunnel to access the metrics endpoint of every pod/node in the cluster, which doesn't actually help our internal use case where engineers only have access to the API and not to run the port-forward command.