kube-state-metrics
kube-state-metrics copied to clipboard
`kube_job_failed` should have `reason` label
What would you like to be added:
Add reason
label here other than condition
.
https://github.com/kubernetes/kube-state-metrics/blob/9e6e70d328c5d750a0df84cc044c38124b271538/internal/store/job.go#L292-L316
Why is this needed:
Enable to monitor why a job fails.
Describe the solution you'd like
-- metric.LabelKeys = []string{"condition"}
++ metric.LabelKeys = []string{"condition", "reason"}
Additional context
I would like to know why the current implementation doesn't allow adding reason
label. Any concerns?
I would like to know why the current implementation doesn't allow adding reason label. Any concerns?
I don't know, but wouldn't using kube_job_status_failed
instead of kube_job_failed
solve your issue?
/triage accepted /assign @CatherineF-dev
Yes, kube_job_status_failed has reason. https://github.com/kubernetes/kube-state-metrics/blob/9e6e70d328c5d750a0df84cc044c38124b271538/internal/store/job_test.go#L207
/close
@CatherineF-dev: Closing this issue.
In response to this:
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.