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

KEP-4346: client-go: Add informer metrics #4349

Merged
merged 6 commits into from
Feb 8, 2024

Conversation

chenk008
Copy link
Contributor

  • One-line PR description: Add informer metrics about reflector/queue/eventHandler.
  • Other comments:

Copy link

linux-foundation-easycla bot commented Nov 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Nov 29, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @chenk008!

It looks like this is your first PR to kubernetes/enhancements 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/enhancements has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 29, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @chenk008. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 29, 2023
@k8s-ci-robot k8s-ci-robot added the kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory label Nov 29, 2023
@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Nov 29, 2023
@chenk008 chenk008 changed the title Add informer metrics [WIP] Add informer metrics Nov 29, 2023
@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 Nov 29, 2023
@chenk008 chenk008 changed the title [WIP] Add informer metrics [draft] Add informer metrics Nov 29, 2023
@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 Nov 29, 2023
@chenk008 chenk008 marked this pull request as draft November 29, 2023 09:07
@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 Nov 29, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 29, 2023
@chenk008 chenk008 changed the title [draft] Add informer metrics Add informer metrics Nov 29, 2023
@chenk008 chenk008 marked this pull request as ready for review November 29, 2023 10:17
@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 Nov 29, 2023
@kikisdeliveryservice kikisdeliveryservice changed the title Add informer metrics KEP-4346: Add informer metrics Nov 30, 2023
@kikisdeliveryservice kikisdeliveryservice changed the title KEP-4346: Add informer metrics KEP-4346: client-go: Add informer metrics Nov 30, 2023
@kikisdeliveryservice
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 1, 2023
add test describe

fill section: Feature Enablement and Rollback

mitigate memory usage

add memory usage metrics

Signed-off-by: chenk008 <kongchen28@gmail.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 7, 2024

- Introduce the informer metrics struct `informerMetrics` contains queue/eventHandler metrics
- Introduce the informer metrics provider interface `informerMetricsProvider`, implement in `k8s.io/component-base/metrics`
- Add an environment to enable informer metrics
Copy link
Member

Choose a reason for hiding this comment

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

why do we need an environment variable to enable them?

Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need an environment variable to enable them?

I think this got updated to a featuregate. This type of metric has been attempted at least once (maybe twice?) and reverted for problems each time. Being able to disable our first attempt could help avoid a rush to patch all the impacted clients.

Copy link
Contributor

Choose a reason for hiding this comment

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

With the new client-go featuregates, we also have the option of enabling early in our control-plane side components via the composition mechanism.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replace it with featuregate, PTAL

Copy link
Contributor

Choose a reason for hiding this comment

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

Replace it with featuregate, PTAL

forgot to push?


- `<package>`: `<date>` - `<test coverage>`

##### Integration tests
Copy link
Member

Choose a reason for hiding this comment

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

IIRC there was some tests for metrics and granularity of them @logicalhan @dgrisonnet can you help us here?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add some tests for metrics subsystem/label/granularity, PTAL

Copy link
Contributor

Choose a reason for hiding this comment

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

Add some tests for metrics subsystem/label/granularity, PTAL

forgot to push?

@deads2k
Copy link
Contributor

deads2k commented Feb 7, 2024

I'm happy with this for apimachinery and PRR. The comments from others should be addressed.

chenk008 and others added 2 commits February 8, 2024 11:22
Co-authored-by: Han Kang <hankang@google.com>
Co-authored-by: Han Kang <hankang@google.com>
@deads2k
Copy link
Contributor

deads2k commented Feb 8, 2024

/tide merge-method-squash

Comment on lines +364 to +365
listDuration SummaryMetric
numberOfItemsInList SummaryMetric
Copy link
Member

Choose a reason for hiding this comment

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

SummaryMetrics are non-aggregatable. It'd be better to use histograms instead.

@deads2k
Copy link
Contributor

deads2k commented Feb 8, 2024

/label tide-merge-method-squash

@k8s-ci-robot
Copy link
Contributor

@deads2k: The label(s) /label tide-merge-method-squash cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, lead-opted-in, tracked/no, tracked/out-of-tree, tracked/yes. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to this:

/label tide-merge-method-squash

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.

@deads2k
Copy link
Contributor

deads2k commented Feb 8, 2024

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Feb 8, 2024
@deads2k
Copy link
Contributor

deads2k commented Feb 8, 2024

It looks like the author agreed to all feedback, forgot to push, and won't make it back online before KEP freeze (timezone check in slack). The delta for the agreed (but forgot to push) changes is small. Rather than miss freeze, I'm going to approve this and accept the minor fix up tomorrow.

Should some comment suddenly become contentious (I doubt it), we'll revert.

approving for apimachinery and PRR.

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chenk008, deads2k

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 Feb 8, 2024
@k8s-ci-robot k8s-ci-robot merged commit 48f7a8f into kubernetes:master Feb 8, 2024
4 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Feb 8, 2024
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/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants