Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

liangyuanpeng
Copy link
Contributor

@liangyuanpeng liangyuanpeng commented Sep 18, 2022

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 18, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 18, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 18, 2022
@liangyuanpeng liangyuanpeng changed the title Add metrics of kube_pod_status_ready_time and kube_pod_status_containers_ready_time [WIP] Add metrics of kube_pod_status_ready_time and kube_pod_status_containers_ready_time Sep 18, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 18, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2022
@coleary-hyperscience
Copy link

It would be great to have this PR merged as it is blocking efforts on my team.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 18, 2022
@azalenski-branch
Copy link

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!

@k8s-ci-robot
Copy link
Contributor

@CatherineF-dev: Closed this PR.

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.

},
},
},
},
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.
Copy link
Contributor

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

@CatherineF-dev
Copy link
Contributor

CatherineF-dev commented Oct 20, 2022

/reopen

Sry, I only want to close that comment..

@k8s-ci-robot k8s-ci-robot reopened this Oct 20, 2022
@k8s-ci-robot
Copy link
Contributor

@CatherineF-dev: Reopened this PR.

In response to this:

/reopen

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
Copy link
Contributor Author

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>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 21, 2022
@liangyuanpeng liangyuanpeng changed the title [WIP] Add metrics of kube_pod_status_ready_time and kube_pod_status_containers_ready_time Add metrics of kube_pod_status_ready_time and kube_pod_status_containers_ready_time Oct 21, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 21, 2022
@@ -12,6 +12,8 @@
| kube_pod_nodeselectors| Gauge | Describes the Pod nodeSelectors | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `nodeselector_NODE_SELECTOR`=&lt;NODE_SELECTOR&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | Opt-in |
| kube_pod_status_phase | Gauge | The pods current phase | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `phase`=&lt;Pending\|Running\|Succeeded\|Failed\|Unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_ready | Gauge | Describes whether the pod is ready to serve requests | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_ready_time | Gauge | Time when pod passed readiness probes. | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_status_container_ready_time | Gauge | Time when the container of the pod entered Ready state. | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
Copy link
Contributor

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.

Copy link
Contributor

@CatherineF-dev CatherineF-dev Oct 21, 2022

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

@dgrisonnet
Copy link
Member

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?

Copy link
Member

@logicalhan logicalhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 3, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: liangyuanpeng, logicalhan
Once this PR has been reviewed and has the lgtm label, please assign fpetkovski for approval by writing /assign @fpetkovski in a comment. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2022
@k8s-ci-robot
Copy link
Contributor

@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.

@fpetkovski
Copy link
Contributor

@liangyuanpeng would you mind resolving conflicts against master?

@liangyuanpeng
Copy link
Contributor Author

liangyuanpeng commented Nov 16, 2022

Sorry for my late and would be work for it in this week.

@rumstead
Copy link

rumstead commented Dec 5, 2022

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?

@akifkhan01
Copy link

akifkhan01 commented Dec 9, 2022

@liangyuanpeng can we please get this merged, it would be of great help to us.
I see that there is only merge conflict to be resolved as a last step.
We are also waiting on this to use this metric in our k8s clusters.

This will enable our customers/users to get better insights into the pod behaviour and fine tune their respective apps wherever necessary.

cc @fpetkovski @logicalhan

@liangyuanpeng
Copy link
Contributor Author

Sorry for my late and i still want to work for it and as soon as push it.

@akifkhan01
Copy link

akifkhan01 commented Dec 9, 2022

Thanks @liangyuanpeng for the response and being on top of it.

@akifkhan01
Copy link

@liangyuanpeng can I help in anyway to get this merged?

@ryanrolds
Copy link
Contributor

I created PR on @liangyuanpeng's fork resolving the merge conflict. Hope it helps. 🤞

@ryanrolds
Copy link
Contributor

ryanrolds commented Dec 27, 2022

At some point this may have to be resolved without further work from the OP.

@dgrisonnet
Copy link
Member

dgrisonnet commented Jan 2, 2023

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.

@ryanrolds
Copy link
Contributor

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.

@mrueg
Copy link
Member

mrueg commented Jan 12, 2023

@liangyuanpeng are you able to proceed with this PR?
Otherwise we will continue on #1938 after mid next week.

@mrueg
Copy link
Member

mrueg commented Jan 19, 2023

Closing this PR as it will be superseded by #1938

Thanks!

@mrueg mrueg closed this Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support kube_pod_ready_time metric