-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kubernetes.pod.status_reason and kubernetes.pod.status.ready_time fields in Kubernetes state_pod metricset #39316
Add kubernetes.pod.status_reason and kubernetes.pod.status.ready_time fields in Kubernetes state_pod metricset #39316
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
metricbeat/docs/fields.asciidoc
Outdated
*`kubernetes.pod.status.ready_time`*:: | ||
+ | ||
-- | ||
Time in unix timestamp for a pod to achieve readiness |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe would be better:
Time in unix timestamp for a pod to achieve readiness | |
Time in unix timestamp when a pod achieved readiness |
or the same as in the ksm: Readiness achieved time in unix timestamp for a pod
Proposed commit message
kubernetes.pod.status_reason
andkubernetes.pod.status.ready_time
fields.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
kind create cluster
elastic-package-0.98.2 stack up -d -v --version=8.14.0-SNAPSHOT
mode="run"
and run:Related issues
Use cases
Screenshots
Logs
Note
I did not manage to find any way that the
kube_pod_status_reason
has any other value than zero. The possible reasons of getting a value of 1 areEvicted, NodeAffinity, NodeLost, Shutdown, UnexpectedAdmissionError
.I tried to create such a situation but in all cases the pod failing reason have been either
Error
orUnschedulable
.These specific reasons are not collected by kube-state-metrics.
The problem though is not related to kube-state-metrics, rather to Kubernetes. When a pod gets evicted Kubernetes should add status reason to
Evicted
but that does not happen.Anyway, I recommend we introduce the new fields as there may be cases that the status reason gets one of the expected values that I cannot reproduce in a local non production cluster.