kube-eagle icon indicating copy to clipboard operation
kube-eagle copied to clipboard

feat(kube-eagle): Add pod labels to metrics

Open Prayer3th opened this issue 5 years ago • 5 comments

  • Add label information for each pod-related metrics

Prayer3th avatar Sep 03 '20 09:09 Prayer3th

This PR adds a single label with the concatenated labels from the scraped pods.

I'm not entirely sure if and how it's possible but the feature request and my personal preference is having separated labels instead, see: https://github.com/cloudworkz/kube-eagle/issues/7

When all nodes in your Kubernetes cluster have a label: nodepool = default this should also be part of the exposed node metrics from Kube eagle. Likewise for pods.

weeco avatar Sep 03 '20 09:09 weeco

I understand what you mean, separate labels are indeed more beautiful and more readable. However, if there is a duplicate label (the same key but different value) in the extra label that is exposed by kube-eagle itself, then one label will be overwritten. So I think it’s more practical to aggregate labels into "labels"

Prayer3th avatar Sep 04 '20 09:09 Prayer3th

This is a valid concern, we could prefix the label_names though (e.g. with eagle_) to guarantee they will be unique and are not going to be overwritten. What do you think?

weeco avatar Sep 05 '20 15:09 weeco

I think your idea is very good, but I encountered another problem during the coding process: the key of each pod label is different, but prometheus seems unable to define dynamic labels. So I think it is more feasible to use the "labels" key to solidify all indicators. When extracting the label, you only need to cut according to the space to get the required data without too much extra work.

Prayer3th avatar Sep 07 '20 06:09 Prayer3th

Any updates?

liorfranko avatar Jun 23 '21 09:06 liorfranko