-
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.container.status.last.reason metric #30306
Add kubernetes.container.status.last.reason metric #30306
Conversation
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
This pull request does not have a backport label. Could you fix it @tetianakravchenko? 🙏
NOTE: |
CHANGELOG.next.asciidoc
Outdated
@@ -180,6 +180,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...main[Check the HEAD dif | |||
- Add `xpack.enabled` support for Enterprise Search module. {pull}29871[29871] | |||
- Add gcp firestore metricset. {pull}29918[29918] | |||
- Remove strict parsing on RabbitMQ module {pull}30090[30090] | |||
- Add `kubernetes.container.status.last.reason` metric {issue}27840|[27840] |
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.
- Add `kubernetes.container.status.last.reason` metric {issue}27840|[27840] | |
- Add `kubernetes.container.status.last.reason` metric {issue}30306|[30306] |
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.
the issue number is 27840, but anyway - changed it to pull
28f2f7e
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.
In general it looks good to me. The only thing I am not 100% sure about is the name of the field. kubernetes.container.status.last.reason
will refer only to reasons of termination. I mean that while kubernetes.container.status.reason
can be either waiting or terminated, the new field is only for terminated. We could name it kubernetes.container.status.last.terminated_reason
to be more precise. I won't insist on that. Just raising a concern. I would like also @ChrsMark opinion
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.
I would go with sth like kubernetes.container.status.terminated_reason
.
@ChrsMark The most precise naming would be |
+1 for |
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
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.
🚀
/test |
* add kubernetes.container.status.last.reason metric Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co> * rename status.last.reason -> status.last_terminated_reason Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co> * fix changelog Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co> (cherry picked from commit aaa36aa) # Conflicts: # metricbeat/module/kubernetes/fields.go
Signed-off-by: Tetiana Kravchenko tetiana.kravchenko@elastic.co
What does this PR do?
Introduce new metric
kubernetes.container.status.last.reason
Why is it important?
we do already have
kubernetes.container.status.reason
(that relies onkube_pod_container_status_terminated_reason
andkube_pod_container_status_waiting_reason
- https://github.com/elastic/beats/blob/main/metricbeat/module/kubernetes/state_container/state_container.go#L74-L75 ), but this one will only be reported when the container/pod is actually down. This might be a quite short period of time ( this is the initial reason of addingkube_pod_container_status_last_terminated_reason
- kubernetes/kube-state-metrics#535)I did not map
kube_pod_container_status_last_terminated_reason
tokubernetes.container.status.reason
, because existence ofkube_pod_container_status_last_terminated_reason
do not excludekube_pod_container_status_waiting_reason
orkube_pod_container_status_terminated_reason
( forkube_pod_container_status_waiting_reason
andkube_pod_container_status_terminated_reason
it is fine to be maped to the samekubernetes.container.status.reason
, because those stated exclude each other - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-states)Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Related issues
Use cases
described in #27840:
Screenshots
Logs