[QUESTION/HELP] Metricbeat kubernetes state_node labels

Hello,

I'm using metricbeat (7.x) and the kubernetes module to fetch kubernetes metrics from api-server and kube-state-metrics. I have a question about the metricset state_node. This metricset will fetch the metrics related to the kubernetes nodes. In the code base of the module I see all the metric name that will be fetch from kube-state-metrics and my question is: Do you include the prometheus labels for each metric ? For example, the module try to get the kube_node_info metricset from kube-state-metric and in this metric I have some relevant labels like the kubelet_version that I can't retrieve in elasticsearch.

kube_node_info{container_runtime_version="docker://1.11.1",kernel_version="4.7.2",kubelet_version="v1.5.3",kubeproxy_version="v1.5.3",node="minikube",os_image="Buildroot 2016.08"} 1

How can we have those labels ? The only way that I found is to add a new prometheus module which point to kube-state-metrics and I fetch again the kube_node_info metric.

Thanks.

Hi!

Your assumption is correct. You can use prometheus module to scrape the metrics along with all the labels.

I guess that state-node metricset does not add all of them for storage efficiency. If you consider adding this specific label could be of benefit in general you can open a Github issue proposing this change, why it is important and your usecase and let the team decide if it can be added.

Thanks!