lens icon indicating copy to clipboard operation
lens copied to clipboard

Support realtime resource metrics without prometheus

Open adammw opened this issue 4 years ago • 15 comments

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:

  • Kubernetes distribution: Custom, running on AWS EC2
  • Desktop OS: macOS 10.15

adammw avatar Apr 22 '20 05:04 adammw

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?

jakolehm avatar Apr 23 '20 05:04 jakolehm

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.

adammw avatar Apr 23 '20 19:04 adammw

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.

ccampo133 avatar Jun 16 '20 13:06 ccampo133

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

kgelinas avatar Nov 25 '20 18:11 kgelinas

I also want to chime in here that the lack of this integration makes it hard to use lens in the same way I use k9s. Getting a list of pods with current CPU/Mem which is updated every so often is useful when checking system health. The time series part could be interesting, but shouldn't be a requirement, as not all clusters have prometheus. For instance, by default a GKE cluster has a metrics-server but not prometheus.

djnym avatar Jan 27 '21 18:01 djnym

In our use case, we have a victoria metrics cluster for multiple k8s clusters. So we don't want to install Prometheus to each cluster

sergeyshevch avatar Mar 25 '22 06:03 sergeyshevch

Completely agree. We don't install the entire prometheus stack in all of our clusters. Many development clusters are very lightweight with only the bare essentials. Supporting metrics-server there would be awesome.

skreienk avatar Aug 18 '22 15:08 skreienk

Same thing here - I don't have prometheus installed and didn't intend to, because Kubernetes Metrics Server works just fine with k9s. So I'm using both, k9s and Lens depending on situation.

viktor-yp avatar Sep 01 '22 13:09 viktor-yp

We have now migrated to datadog instead of prometheus. So getting the historical values of cpu and memory would be had there, but for instantaneous usage metrics i end up having to falling back to k9s.

iammoen avatar Oct 14 '22 17:10 iammoen

any news on this topic? context: Edge installations of k8s, where resources are very constrained, might not need prometheus, which is a bit overkill for such application.

relying on metrics server instead would be amazing

dberardo-com avatar Jul 05 '23 16:07 dberardo-com

I use k3s , do not want to add Prometheus, just want support real time Metrics Server

leohxj avatar Aug 10 '23 07:08 leohxj

This is still relevant, please it would be a big enhancement to be able to see metrics from metric-server in real-time despite of not having time series data.

MarckFp avatar Sep 27 '23 11:09 MarckFp

Any chance we can make metrics pluggable? For instance, if there were a way to set a metrics plugin, then as a datadog shop, I could put in an API key and pull time series data from there. The same is probably true of other third party monitoring solutions.

jcogilvie avatar Nov 15 '23 16:11 jcogilvie

it would be great if Lens could get those metrics from Datadog

walec51 avatar Jan 10 '24 15:01 walec51

subscribing here for updates do not want to have extra prometheus in my test cluster but want to see real time metrics for nodes in lens

casualuser avatar May 15 '24 17:05 casualuser