Skip to content

Metric kube_pod_status_reason returns hundreds of results, but all with a zero value #2116

Closed
@jgagnon44

Description

@jgagnon44

What happened:
Running a PromQL query on the kube_pod_status_reason metric returns hundreds of result records, but every one has a value of zero. This occurs even with pods in failed or pending status.

What you expected to happen:
I would expect for cases where any pods in failed or pending status to have a result from this metric with a non-zero value.

How to reproduce it (as minimally and precisely as possible):
Run a query in Prometheus on kube_pod_status_reason. No filtering is needed. I get hundreds of result entries, every one with a value of zero.

If you run the query slightly differently: kube_pod_status_reason > 0 you will get an empty response, even with pods in failed or pending status.

Anything else we need to know?:

Environment:

  • kube-state-metrics version:

Not sure how to find this.

I don't know if this is equivalent. I inspected the pod and found the following:

  containers:
    - name: kube-state-metrics
      image: k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0
  • Kubernetes version (use kubectl version):
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"clean", BuildDate:"2022-06-15T14:22:29Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"windows/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.9", GitCommit:"9710807c82740b9799453677c977758becf0acbb", GitTreeState:"clean", BuildDate:"2022-12-08T10:08:06Z", GoVersion:"go1.18.9", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration:
Everything in on premises.
  • Other info:

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions