Goroutines metrics for Rancher pod?

Hi

How do i get the “number of goroutines” metric for the Rancher pods?

The same metric is exposed e.g. by the node_exporter as go_goroutines. But i assume this metric is just for the node_exporter pod. not for Rancher itself.

I’m trying to verify the same that was found here:

The OOM killer is regularly killing our Rancher pods and just trying to work out what is going on…

Hi I’m author of above blog, thanks for reading.

Let me answer for your question.
At default, rancher would not expose metrics.
But if you specify CATTLE_PROMETHEUS_METRICS=true in environment variable for rancher-server container, you will be able to access https:///metrics endpoint


One thing you need to be aware of is that this functionality is newly introduced from 2.4 (if i remember correctly). That’s why your rancher-server may not support this yet if you are using earlier than 2.4

The reason why above blog could get metrics from rancher-server even earlier than 2.4 is we build rancher-server binary with several our custom patch.