'How can I check cadvisor which is included in kubelet?

I have multiple kubernetes clusters, whose versions are 1.13, 1.16, 1.19.

I'm trying to monitor the total number of threads so that I need the metric "container_threads".

But for the cluster version equal or lower than 1.16, the container_threads metric looks like somewhat wrong.

For 1.16, the metric values is always 0, for 1.13 no container_threads metrics exists.

I know that the metric is from cadvisor which is included in kubelet.

I want to make sure that from which version, the cadvisor doesn't have container_threads.

I know how to check kubelet version "kubelet --version".

But I don't know how to find the version of cadvisor.

Does anyone know about it?

Thanks!



Solution 1:[1]

There is no specific command to find the version of cAdvisor. However, metrics can be accessed using commands like $ kubectl top

For Latest Version Of Cadvisor , We will use the official cAdvisor docker image from google hosted on the Docker Hub.

For more information about cAdvisor UI Overview and Processes, over to the cAdvisor section. Also, cAdvisor’s UI has been marked deprecated as of Kubernetes version 1.10 and the interface is scheduled to be completely removed in version 1.12.

If you run Kubernetes version 1.12 or later, the UI has been removed. However, the metrics are still there since cAdvisor is part of the kubelet binary.

The kubelet binary exposes all its runtime metrics and all the cAdvisor metrics at the /metrics endpoint using the Prometheus exposition format.

Note: cAdvisor doesn’t store metrics for long-term use, so if you want that functionality, you’ll need to look for a dedicated monitoring tool.

Solution 2:[2]

The cAdvisor version can be found through the cadvisor_version_info metric which is exposed in the /metrics endpoint of your cAdvisor service.

I believe the metric was added in cAdvisor v.0.18.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Khaja Shaik
Solution 2 batto