-
Notifications
You must be signed in to change notification settings - Fork 778
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
feat: More verbose logging for audit #2503
Conversation
Signed-off-by: Max Smythe <[email protected]>
Codecov ReportBase: 53.88% // Head: 53.91% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2503 +/- ##
==========================================
+ Coverage 53.88% 53.91% +0.03%
==========================================
Files 116 116
Lines 10272 10277 +5
==========================================
+ Hits 5535 5541 +6
Misses 4311 4311
+ Partials 426 425 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
would we want any of these to be using |
pkg/audit/manager.go
Outdated
@@ -368,6 +368,7 @@ func (am *Manager) auditResources( | |||
for gv, gvKinds := range clusterAPIResources { | |||
kindsLoop: | |||
for kind := range gvKinds { | |||
log.Info("Listing objects for GVK", "group", gv.Group, "version", gv.Version, "kind", kind) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we want this line and the following to actual use the manager log? am.log
. Before we call auditResources
we actually tag the audit manager log w the auditID
which could be used to aggregate audit runs.
https://github.com/open-policy-agent/gatekeeper/blob/master/pkg/audit/manager.go#L165
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that one defaults to always log. +1 on exposing verbosity to the operator so it doesn't flood the logs unless you need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, yes, am.log() is a better call.
@ritazh I think logging/not logging is governed by the log level flag?
Signed-off-by: Max Smythe <[email protected]>
addressed feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* feat: More verbose logging for audit Signed-off-by: Max Smythe <[email protected]> * Reduce log priority Signed-off-by: Max Smythe <[email protected]> Signed-off-by: Max Smythe <[email protected]>
Signed-off-by: Max Smythe [email protected]
What this PR does / why we need it:
This will help diagnose performance issues in audit, such as those mentioned in #2502
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer: