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 a feature enabled metric #112652

Merged
merged 3 commits into from Sep 22, 2022
Merged

Conversation

logicalhan
Copy link
Member

@logicalhan logicalhan commented Sep 21, 2022

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

We need a generic way to determine if a feature is enabled.

Adds a kubernetes_feature_enabled metric which will tell you if a feature is enabled.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 21, 2022
@logicalhan
Copy link
Member Author

/cc @deads2k @johnbelamaric

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 21, 2022
@logicalhan logicalhan force-pushed the feature-metric branch 2 times, most recently from faaddc7 to e3eff40 Compare September 21, 2022 20:15
Change-Id: Id872651c4219d4749fc4227da7d944e883e4e355
featureEnabled.Reset()
}

func RecordFeatureEnabled(ctx context.Context, name string, enabled bool) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a suggestion for where something like the kubelet would wire in the calls to RecordFeatureEnabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you think of just throwing this in featuregate.go? Then we're basically just done.

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think of just throwing this in featuregate.go? Then we're basically just done.

That's fine with me, thanks.

@logicalhan
Copy link
Member Author

/assign @dgrisonnet @dashpole

Change-Id: Iccab766ba2ee16ef54abb79e41ee61a6117fa7dd
@dashpole
Copy link
Contributor

/approve
/triage accepted
/priority important-soon
This looks amazing. Can't believe we haven't thought of this before.
I'll let damien take a look and lgtm

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 22, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dashpole, logicalhan

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

@logicalhan
Copy link
Member Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2022
@logicalhan
Copy link
Member Author

/retest

Change-Id: Ia0f65bec6c0dc092c3db9b5b1c22059a0c8c9776
@dgrisonnet
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 22, 2022
@logicalhan
Copy link
Member Author

/retest

@logicalhan
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2022
@logicalhan
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 8631b2c into kubernetes:master Sep 22, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Sep 22, 2022
@jberkus
Copy link

jberkus commented Sep 27, 2022

As with the other PR, this should be listed as a feature for 1.26.

@logicalhan
Copy link
Member Author

As with the other PR, this should be listed as a feature for 1.26.

I mean, it'll be in the release notes.

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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants