[VC-36032] Configure controller-runtime to log with klog#626
Merged
Conversation
Signed-off-by: Richard Wall <richard.wall@venafi.com>
3 tasks
wallrj
commented
Nov 20, 2024
| // TODO(mael): The rest of the codebase uses the standard "log" package, | ||
| // venafi-connection-lib uses "go-logr/logr", and client-go uses "klog". We | ||
| // should standardize on one of them, probably "slog". | ||
| ctrlruntimelog.SetLogger(logr.Logger{}) |
Contributor
Author
There was a problem hiding this comment.
|
|
||
| extraArgs: | ||
| - --logging-format=json | ||
| - --log-level=2 |
Contributor
Author
There was a problem hiding this comment.
I changed this so that could see trace level logs in the e2e test.
As it happens, the single controller-runtime log message from venafi-connection-lib is at level 0, so this change is not strictly necessary.
Member
I remember adding this log line in venafi-connection-lib's // We found a niche problem where `/metrics` would hang forever in case of a
// misconfigured RBAC. This was due to `cache.List` hanging until the cache
// is synced. To prevent that, we skip reporting this subset of the metrics.
if !hasSynced(cc.cache) {
cc.log.Info("cache not synced yet, skipping metrics venaficonnection_*")
return
}I don't know why |
maelvls
approved these changes
Nov 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I assume that the controller-runtime logs were being discarded.
With this change I hope to find some controller-runtime logs among the e2e test logs.
Testing
That single message seems to come from venafi-connection-lib, so perhaps it's misleading to label these logs with
source: "controller-runtime":@maelvls Does that log message indicate a bug in the way we're instantiating the venafi-connection-lib client?