-
Notifications
You must be signed in to change notification settings - Fork 1.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 metrics of kube_pod_status_ready_time and kube_pod_status_containers_ready_time #1837
Conversation
a5cc434
to
de36d25
Compare
It would be great to have this PR merged as it is blocking efforts on my team. |
d9305d0
to
bb4c9ff
Compare
Would love to see this PR merged, as those metrics are valuable in determining pod startup times and issues related to it. If needed can definitely help with making sure the code meets all the requirements. @dgrisonnet @fpetkovski Do you think you can review this in the upcoming days? Thanks! |
@CatherineF-dev: Closed this PR. In response to this:
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. |
internal/store/pod_test.go
Outdated
}, | ||
}, | ||
}, | ||
}, | ||
Want: ` | ||
# HELP kube_pod_status_ready [STABLE] Describes whether the pod is ready to serve requests. | ||
# TYPE kube_pod_status_ready gauge | ||
# HELP kube_pod_status_ready_time Readiness achieved time in unix timestamp for a pod. |
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 test for kube_pod_status_container_ready_time
/reopen Sry, I only want to close that comment.. |
@CatherineF-dev: Reopened this PR. In response to this:
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. |
I'm working for rebase commit and finish it tomorrow. |
Co-authored-by: Szymon Grzemski <sz.grzemski@gmail.com> Signed-off-by: Lan Liang <gcslyp@gmail.com>
85c7555
to
f36b8e6
Compare
@@ -12,6 +12,8 @@ | |||
| kube_pod_nodeselectors| Gauge | Describes the Pod nodeSelectors | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `nodeselector_NODE_SELECTOR`=<NODE_SELECTOR> <br> `uid`=<pod-uid> | EXPERIMENTAL | Opt-in | | |||
| kube_pod_status_phase | Gauge | The pods current phase | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `phase`=<Pending\|Running\|Succeeded\|Failed\|Unknown> <br> `uid`=<pod-uid> | STABLE | - | | |||
| kube_pod_status_ready | Gauge | Describes whether the pod is ready to serve requests | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `condition`=<true\|false\|unknown> <br> `uid`=<pod-uid> | STABLE | - | | |||
| kube_pod_status_ready_time | Gauge | Time when pod passed readiness probes. | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | | |||
| kube_pod_status_container_ready_time | Gauge | Time when the container of the pod entered Ready state. | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | |
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.
Let's start with making the metrics experimental, and we can graduate them over time.
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.
Agree.
You can use generator.NewFamilyGeneratorWithStability instead of generator.NewFamilyGenerator to state it's experimental. (basemetrics.ALPHA)
Example PR: #1844
I am fine with these new metrics. To address some initial concerns that were raised in #1465 (comment), it is very unlikely that these metrics will surface in kubelet today due to their cardinality, so I think they are a good fit for ksm. @liangyuanpeng there is still one unresolved comment, could you have a look at it when you have some times on your hands? |
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.
/lgtm
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liangyuanpeng, logicalhan The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@liangyuanpeng: PR needs rebase. 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. |
@liangyuanpeng would you mind resolving conflicts against master? |
Sorry for my late and would be work for it in this week. |
@liangyuanpeng anything I can do to help get this over the finish line? |
@liangyuanpeng can we please get this merged, it would be of great help to us. This will enable our customers/users to get better insights into the pod behaviour and fine tune their respective apps wherever necessary. |
Sorry for my late and i still want to work for it and as soon as push it. |
Thanks @liangyuanpeng for the response and being on top of it. |
@liangyuanpeng can I help in anyway to get this merged? |
I created PR on @liangyuanpeng's fork resolving the merge conflict. Hope it helps. 🤞 |
At some point this may have to be resolved without further work from the OP. |
Since @liangyuanpeng expressed their intention to push this effort over the finish line I'd rather wait a bit more for them to get the time they need to work on it again rather than prevent them to finish the work they started. I would only reconsider that if we are close to a release and the PR hasn't been merged already, but for now there is no hurry at all so don't feel pressured. |
I had to preform a rebase and deal with merge conflicts (new method was inserted in the same spot as methods added by these PRs) in the other PR. I'm not going to say I won't keep up with the rebases and merge conflicts in the other PR, but I would appreciate not having to spend that time. |
@liangyuanpeng are you able to proceed with this PR? |
Closing this PR as it will be superseded by #1938 Thanks! |
What this PR does / why we need it:
Base PR #1482
Ref: Adds kube_pod_status_ready_time and kube_pod_status_containers_ready_time metrics to get the information provided by Pod Lifecycle's PodConditions array.
Maybe we should support param to open this feature or not, juse like
feature-gates
.How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
increases metrics number that Pod number * 2
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1465,#1830
Co-authored-by: Szymon Grzemski sz.grzemski@gmail.com
Signed-off-by: Lan Liang gcslyp@gmail.com