Kube-state-metrics: tags/labels missing for daemonset, deployment, and replicaset metrics

Created on 22 Sep 2020  路  10Comments  路  Source: kubernetes/kube-state-metrics

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line:

/kind bug
/kind feature

What happened:
metrics for daemonset, deployment, and replicaset no longer export tags/labels

What you expected to happen:
metrics for daemonset, deployment, and replicaset to include tags/labels

How to reproduce it (as minimally and precisely as possible):
create daemonset, deployment, or replicaset. poll kube-state-metrics endpoint. look at, for example, kube_replicaset_created metrics. observe no tags/labels are attached to it.

Anything else we need to know?:
v1.9.7 does not exhibit this issue. below is a sample comparison with kube_*_created. the same behavior is observed with all daemonset, deployment, and replicaset metrics.

v2.0.0-alpha:
kube_replicaset_created 1.600788121e+09

kube_deployment_created 1.600788121e+09

kube_daemonset_created 1.600790245e+09=

kube_configmap_created{namespace="openshift-console",configmap="console-config"} 1.600780846e+09

v1.9.7:
kube_replicaset_created{namespace="openshift-console",replicaset="console-fcbd85f55"} 1.600780846e+09

kube_deployment_created{namespace="openshift-web-console",deployment="webconsole"} 1.600780806e+09

kube_daemonset_created{namespace="openshift-node",daemonset="sync"} 1.600780702e+09

kube_configmap_created{namespace="openshift-console",configmap="console-config"} 1.600780846e+

Environment:

  • Kubernetes version (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.0+d4cacc0", GitCommit:"d4cacc0", GitTreeState:"clean", BuildDate:"2018-10-15T09:45:30Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.0+d4cacc0", GitCommit:"d4cacc0", GitTreeState:"clean", BuildDate:"2020-09-04T19:45:00Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:58:53Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:51:04Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

kinbug

Most helpful comment

@jimmyseto thanks, I could reproduce it locally, looking into what was causing the problem, I have a suspicion. Thank you so much for your testing and the report, its super useful! 馃帀

All 10 comments

@lilic fyi. thanks.

@jimmyseto Thanks for the issue, can you share the deployment for kube-state-metrics itself, thanks!

@jimmyseto Thanks for the issue, can you share the deployment for kube-state-metrics itself, thanks!

@lilic i just deployed using what's in example/standard (https://github.com/kubernetes/kube-state-metrics/tree/master/examples/standard).

just as another datapoint, using the same deployment (and simply changing the image to 1.9.7), i see the expected results.

@jimmyseto thanks, I could reproduce it locally, looking into what was causing the problem, I have a suspicion. Thank you so much for your testing and the report, its super useful! 馃帀

@lilic Looks like it's a closure loop issue with the label filtering. I fix it here https://github.com/kubernetes/kube-state-metrics/pull/1041/files#diff-5ca58d412bc2ec4e34ceaa2ad2cde1eb

I met same problem on v2.0.0-alpha

image

@jw-s thanks, do you mind adding that bug fix in a separate PR, as we want to backport that to the release-2.0 branch, thanks!

@lilic No worries, I've raised the PR

thanks for the quick turnaround on this, @jw-s ! verified with a manual build of the latest/greatest off the release-2.0 branch, and confirmed that this is now fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

therc picture therc  路  4Comments

jingzhao-self picture jingzhao-self  路  4Comments

dghubble picture dghubble  路  3Comments

roobre picture roobre  路  7Comments

natalysheinin picture natalysheinin  路  6Comments