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-4008: CRDValidationRatcheting Metrics #121462

Conversation

alexzielenski
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds metrics to the comparison for CRDValidationRatcheting

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

/sig api-machinery
/assign @apelisse

This was split off of #121343 and is based on top of it, so requires it to merge first.

Does this PR introduce a user-facing change?

Adds `apiextensions_apiserver_update_ratcheting_time` metric for tracking time taken during requests by feature `CRDValidationRatcheting`

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://kep.k8s.io/4008

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 24, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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 Oct 24, 2023
@alexzielenski alexzielenski force-pushed the apiserver/apiextensions/ratcheting-metrics-actually branch from abbe62e to 5891b78 Compare October 24, 2023 20:42
@alexzielenski alexzielenski force-pushed the apiserver/apiextensions/ratcheting-metrics-actually branch from 5891b78 to b9bb88e Compare October 25, 2023 21:54
@alexzielenski alexzielenski changed the title [WIP] KEP-4008: CRDValidationRatcheting Metrics KEP-4008: CRDValidationRatcheting Metrics Oct 25, 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 Oct 25, 2023
Name: "ratcheting_seconds",
Help: "Time for comparison of old to new for the purposes of CRDValidationRatcheting during an UPDATE in seconds.",
StabilityLevel: metrics.ALPHA,
// Start 0.01ms with the last bucket being [~2.5s, +Inf)
Copy link
Member

Choose a reason for hiding this comment

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

is 2.5s enough?

Copy link
Member

Choose a reason for hiding this comment

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

IMO, 2.5s is basically infinite time yeah. I have very little patience.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. For the comparison to be on the order of seconds is already very concerning. IMO higher buckets wouldn't give much more information than 2.5s

@leilajal
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 26, 2023
@alexzielenski alexzielenski force-pushed the apiserver/apiextensions/ratcheting-metrics-actually branch from b9bb88e to 3d8b921 Compare October 26, 2023 22:18
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
/approve

(from a sig-instrumentation perspective)

@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, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 995b2c3892867966518a602adebe60f377519320

t.Run(tt.desc, func(t *testing.T) {
defer func() {
// No reset function for prometheus histogram metric
// so recreate it (can't use newValidationMetrics() because it's private
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/hold

cc @logicalhan had some difficulties here resetting the histogram metric since it is not a Vec and does not expose a Reset(). For now the tests are order dependent.

Do you have any advice to workaround?

EDIT: comment is inaccurate, since re-registering is not allowed

@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 Oct 26, 2023
@alexzielenski alexzielenski force-pushed the apiserver/apiextensions/ratcheting-metrics-actually branch from 3d8b921 to 5293b0c Compare October 26, 2023 22:59
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 26, 2023
@alexzielenski alexzielenski force-pushed the apiserver/apiextensions/ratcheting-metrics-actually branch from 5293b0c to 894a31b Compare October 27, 2023 04:10
Copy link
Contributor

@jpbetz jpbetz left a comment

Choose a reason for hiding this comment

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

/approve

The metric def and the bucket distribution LGTM. Leaning on @logicalhan's review of the instrumentation specifics.

@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 27, 2023
@alexzielenski alexzielenski force-pushed the apiserver/apiextensions/ratcheting-metrics-actually branch from 894a31b to c73ffe7 Compare October 27, 2023 16:21
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

for metrics

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

LGTM label has been added.

Git tree hash: 787feb05ddbdbcf3635bc19a57d8abae415084da

@alexzielenski alexzielenski force-pushed the apiserver/apiextensions/ratcheting-metrics-actually branch from c73ffe7 to 4bb7dc2 Compare October 27, 2023 17:57
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2023
@alexzielenski
Copy link
Contributor Author

Added another check to the test that the real durations is > 0, and cleaned up naming a little.

/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 Oct 27, 2023
@dims
Copy link
Member

dims commented Oct 27, 2023

@logicalhan @jpbetz needs lgtm to be re-applied after the last change

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

(for metrics)

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

LGTM label has been added.

Git tree hash: 00b15fa4a923801c8e1398db3ca2c6e1d4290dd9

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexzielenski, jpbetz, 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

@k8s-ci-robot k8s-ci-robot merged commit 1aef58b into kubernetes:master Oct 27, 2023
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 27, 2023
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. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. 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

7 participants