Skip to content

Track dry-run and apply in metrics#74997

Merged
k8s-ci-robot merged 4 commits intokubernetes:masterfrom
jennybuckley:apply-metrics
Mar 8, 2019
Merged

Track dry-run and apply in metrics#74997
k8s-ci-robot merged 4 commits intokubernetes:masterfrom
jennybuckley:apply-metrics

Conversation

@jennybuckley
Copy link
Copy Markdown

@jennybuckley jennybuckley commented Mar 5, 2019

What type of PR is this?
/kind feature
/sig api-machinery
/wg apply
/priority important-soon

What this PR does / why we need it:
Example value of the metric from kube-up

...
apiserver_request_total{client="kubectl/v0.0.0 (linux/amd64) kubernetes/$Format",code="201",component="apiserver",contentType="application/json",dry_run="All",grou
p="apps",resource="deployments",scope="namespace",subresource="",verb="APPLY",version="v1"} 4
...

Which issue(s) this PR fixes:
Tracked in #73723

Does this PR introduce a user-facing change?:

New "dry_run" metric label (indicating the value of the dryRun query parameter) into the metrics:
* apiserver_request_total
* apiserver_request_duration_seconds
New "APPLY" value for the "verb" metric label which indicates a PATCH with "Content-Type: apply-patch+yaml". This value is experimental and will only be present if the ServerSideApply alpha 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. kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. wg/apply priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/apiserver labels Mar 5, 2019
Copy link
Copy Markdown
Member

@apelisse apelisse Mar 5, 2019

Choose a reason for hiding this comment

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

Since this is supposed to be a list of strings, and we currently only support one string, maybe you should keep it as the input string?

Copy link
Copy Markdown
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.

Generally looks good. Just one observation/question.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 5, 2019
@fejta-bot
Copy link
Copy Markdown

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

Copy link
Copy Markdown
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.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2019
@jennybuckley
Copy link
Copy Markdown
Author

I'm not exactly sure why this is considered an API changing PR, I think because I made changes to staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go, but I only changed a function name, so the API is unchanged.
@kubernetes/api-approvers

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Mar 6, 2019

https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/apis/OWNERS#L11 adds the kind/api-change label, which is what the bot watches for

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll update this, thanks. I only put "dryRun" to conform with the existing "contentType" label

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree that consistency should matter more here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks terrible to have both, but you should probably do what sig instrumentation wants; leave a comment, though.

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Mar 6, 2019

two nits, lgtm otherwise

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2019
@apelisse
Copy link
Copy Markdown
Member

apelisse commented Mar 7, 2019

/retest
:-)

if errs := validation.ValidateDryRun(nil, dryRun); len(errs) > 0 {
return "invalid"
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

strings.Join(sets.NewString(dryRun...).List(),",") will dedupe and sort for you if you want to collapse onto that

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Mar 7, 2019

one comment about the synthetic verb, and one optional comment about using sets.NewString() if you want to use that

a good follow up would be to do some sort of cleanup on contentType values as well to reduce cardinality edit: contentType is what we send back, which isn't concerningly high cardinality

@jennybuckley
Copy link
Copy Markdown
Author

/retest

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Mar 7, 2019

/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 Mar 7, 2019
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jennybuckley, liggitt

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

The pull request process is described here

Details 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 Mar 7, 2019
@jennybuckley
Copy link
Copy Markdown
Author

/retest

2 similar comments
@jennybuckley
Copy link
Copy Markdown
Author

/retest

@jennybuckley
Copy link
Copy Markdown
Author

/retest

@jennybuckley
Copy link
Copy Markdown
Author

/milestone 1.14

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@jennybuckley: You must be a member of the kubernetes/kubernetes-milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your and have them propose you as an additional delegate for this responsibility.

Details

In response to this:

/milestone 1.14

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.

@lavalamp
Copy link
Copy Markdown
Contributor

lavalamp commented Mar 8, 2019

/milestone 1.14

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@lavalamp: The provided milestone is not valid for this repository. Milestones in this repository: [next-candidate, v1.10, v1.11, v1.12, v1.13, v1.14, v1.15, v1.16, v1.17, v1.18, v1.4, v1.5, v1.6, v1.7, v1.8, v1.9]

Use /milestone clear to clear the milestone.

Details

In response to this:

/milestone 1.14

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.

@lavalamp
Copy link
Copy Markdown
Contributor

lavalamp commented Mar 8, 2019

/milestone v1.14

@jennybuckley
Copy link
Copy Markdown
Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 81e8401 into kubernetes:master Mar 8, 2019
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. 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/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. 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.

7 participants