-
Notifications
You must be signed in to change notification settings - Fork 2
Adds more logging and klog logging again #2279
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
* Support enabling verbose client-go logging - Can set via extraEnvVars in helm chart - Allows debugging of k8s client things * Fix linting error
- Disable background cache processes that use the cluster-service SA to query leaf clusters when only OIDC have access (token-passthrough)
I wonder if we shouldn't use https://github.com/kubernetes/klog/tree/main/klogr as our "logr.Logger" implementation so that we have similar log-levels etc? |
// v=5 - log CRD cache things? | ||
// v=6 - log requests (e.g. GET url) | ||
// v=7 - log req/res headers | ||
// v=8 - log res body |
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.
Probably! I find 1-9 much less intuitive than debug/info/trace but thats probably a familiarity thing. But if most tooling in the ecosystem uses it then it makes more sense. Though our mapping seems to be the inverse of klog internally too https://github.com/weaveworks/weave-gitops/blob/62860b066700b92f95a57bd8de6fc7dd4d7beb9f/core/logger/logger.go#L19-L28 (smaller means more verbose here).. We could probably still keep client-go's logging level vs cluster-service logging level at different levels? |
The simple way to think about "verbosity" is The subtlety of "trace" and "debug" is hard to figure out, for example, "trace" is meant to be more granular than "debug". |
Is this still needed? |
This is pretty cool for debugging stuff.. I will try and reincarnate it. |
Closing for now |
Uses weaveworks/weave-gitops#3308
This branch tries to provide a nice env for debugging OIDC token passthrough issues
Recommended setup for debugging
WEAVE_GITOPS_FEATURE_USE_USER_CLIENT_FOR_NAMESPACES
Assumptions
The system should not be making any more requests to leaf clusters using the cluster-service SA.
Full HelmRelease / HelmRepo from recent head on this branch