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

pod: add gauge for runtimeclass handler #1276

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

egernst
Copy link
Contributor

@egernst egernst commented Oct 23, 2020

What this PR does / why we need it:

This adds a metric for observability of the RuntimeClass feature:
kube_pod_runtimeclass_handler

Using this metrics allows end-users to quickly verify that the RuntimeClass feature is being utilized and is healthy.

When combined with the kube_pod_status_phase, end-users can use tools like grafana to quickly assess how pods running with a particular runtimeclass are behaving compared to other runtimeclasses and the default runtime.

Which issue(s) this PR fixes

Fixes: #1274

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 23, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Oct 23, 2020
@egernst
Copy link
Contributor Author

egernst commented Oct 23, 2020

/cc @SergeyKanzhelev @tallclair

@SergeyKanzhelev
Copy link
Member

I have limited context here. From looking at the code around it looks consistent and seems to be taking the proper value for the dimension. As next step maybe we can add supported runtime handlers to the kube_node_info

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 23, 2020
@egernst
Copy link
Contributor Author

egernst commented Oct 23, 2020

I have limited context here. From looking at the code around it looks consistent and seems to be taking the proper value for the dimension. As next step maybe we can add supported runtime handlers to the kube_node_info

/lgtm

Interesting. I'm not sure there's an easy way for the node to know in a clean way what runtime handlers are available. RuntimeClass can optionally specify the nodeSelect, but that isn't always necessarily used.

}),
),
*generator.NewFamilyGenerator(
"kube_pod_runtimeclass_handler",
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a unit test for this, thanks! :)

Copy link
Member

Choose a reason for hiding this comment

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

As per best practices the name should be kube_pod_runtimeclass_handler_info, can you adjust that as well, thanks!

@lilic
Copy link
Member

lilic commented Oct 26, 2020

As next step maybe we can add supported runtime handlers to the kube_node_info

What would be the use of that metric?

@lilic
Copy link
Member

lilic commented Oct 26, 2020

To answer the issue question: If you manage to address the comment before our next release (which will be tomorrow most likely) we can merge this into 2.0.0-alpha.2 cut, otherwise it will have to wait until 2.0 is shipped as we are going into code freeze after that for 2.0.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 26, 2020
@egernst
Copy link
Contributor Author

egernst commented Oct 26, 2020

Thanks for the quick feedback @lilic. I updated the commit to include unit test (whoops sorry!) and to add _info to the metric name.

I also changed the metric name from runtimeclass_handler to runtimeclass_name.

@egernst egernst force-pushed the runtimeclass branch 3 times, most recently from 46ce5c3 to e09eb53 Compare October 26, 2020 14:59
Add a metric gauge to provide observability for the runtimeclass
used for running a pod.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: egernst, lilic, SergeyKanzhelev

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2020
@k8s-ci-robot k8s-ci-robot merged commit 00085a1 into kubernetes:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. 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.

Add RuntimeClass metrics
4 participants