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

✨ Improve webhook loggings #439

Merged
merged 1 commit into from
Oct 22, 2019

Conversation

anthonyho007
Copy link
Contributor

I have added more logs at places where it deems necessary. If you guys have any good ideas, please let me know!

Issue: #340

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 21, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 21, 2019
pkg/webhook/server.go Outdated Show resolved Hide resolved
pkg/webhook/server.go Outdated Show resolved Hide resolved
pkg/webhook/admission/http.go Outdated Show resolved Hide resolved
@@ -132,6 +134,7 @@ func (s *Server) Start(stop <-chan struct{}) error {
if _, err := inject.LoggerInto(baseHookLog.WithValues("webhook", hookPath), webhook); err != nil {
return err
}
baseHookLog.Info("loaded webhook in", "webhook path", hookPath)
Copy link
Member

Choose a reason for hiding this comment

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

IMO we should put it in

func (s *Server) Register(path string, hook http.Handler) {

baseHookLog.Info("registering webhook", "path", path)
s.webhooks[path] = hook
s.WebhookMux.Handle(path, instrumentedHook(path, hook))

pkg/webhook/server.go Outdated Show resolved Hide resolved
@anthonyho007 anthonyho007 force-pushed the improve-loggings branch 2 times, most recently from fb99b3c to de136cc Compare May 31, 2019 18:22
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2019
Copy link
Member

@mengqiy mengqiy 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 for improving the logging.

@mengqiy mengqiy added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 1, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2019
@anthonyho007
Copy link
Contributor Author

force pushed to sync with master branch

@DirectXMan12 DirectXMan12 changed the title ✨ (:sparkles, minor) Improve webhook loggings ✨ Improve webhook loggings Jun 3, 2019
Copy link
Contributor

@DirectXMan12 DirectXMan12 left a comment

Choose a reason for hiding this comment

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

a couple of these changes (potentially) dramatically increase log volume, or log potentially large objects. need to consider this a bit

@anthonyho007
Copy link
Contributor Author

anthonyho007 commented Jun 13, 2019

Hi @DirectXMan12! Instead of logging the entire struct of admissionResponse and admissionRequest, i have selected a couple fields to be included in the logs. Plz let me know if this is okay 😃 !

@DirectXMan12
Copy link
Contributor

that looks a lot better

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anthonyho007, DirectXMan12

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

@mengqiy
Copy link
Member

mengqiy commented Oct 10, 2019

@anthonyho007 can you please fix the failing tests?

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

mengqiy commented Oct 21, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 21, 2019
@mengqiy
Copy link
Member

mengqiy commented Oct 22, 2019

/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 22, 2019
@k8s-ci-robot k8s-ci-robot merged commit ad57a97 into kubernetes-sigs:master Oct 22, 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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants