-
Notifications
You must be signed in to change notification settings - Fork 126
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 logging in Controllers by adding relevant context #1880
Comments
I would like to work on this @bacherfl |
@sudiptob2 this is the issue we discussed |
@thisthat Could you please assign this issue to me |
reopening because the merged PR #2253 is part of the issue, but the other operators remain to be improved |
@geoffrey1330 you gotta explain to me how you solved this issue 😄 |
Sure. you can hit me up on keptn slack channel |
Details
Right now, the controllers often produce logs that do not provide much value, due to missing context. A good example for that is this one:
lifecycle-toolkit/lifecycle-operator/controllers/lifecycle/keptnappversion/controller.go
Line 75 in 2558f74
This will generate something like:
On one side, this is helpful to indicate the start of a new reconciliation loop, but does not help much if I want to use the logs for debugging the reconciliation of a particular object in a cluster with a large number of resources. In some other places, this is done better by making use of the
keysAndValues
parameter of the logger's logging functions, where a list of keys and values is attached to a log line, as in the following:Adding this context makes it way easier to actually use the logs for troubleshooting by filtering on e.g. a certain namespace, or the name of a resource.
The goal of this ticket should be to figure out a set of properties that should be attached to each log line, and make these available via a common function. Properties like
name
,namespace
kind
are good candidates, but others may also prove to be useful.DoD
The text was updated successfully, but these errors were encountered: