-
Notifications
You must be signed in to change notification settings - Fork 511
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
Migrate to contextual logging #743
Comments
/remove-kind bug |
Hi @googs1025, thanks for the interest, I think it would be great if we can migrate all logs to contextual logging since the k/k is working hard on it. feel free to take it and raise PRs for it! |
@zwpaper thanks for reply. I want to confirm some details first. Do we need to replace the original The following code lh := klog.FromContext(ctx).WithValues(logging.KeyPod, klog.KObj(pod), logging.KeyPodUID, logging.PodUID(pod), logging.KeyNode, nodeName)
lh.V(4).Info(logging.FlowBegin)
defer lh.V(4).Info(logging.FlowEnd)
nodeTopology, ok := tm.nrtCache.GetCachedNRTCopy(ctx, nodeName, pod)
if !ok {
lh.V(2).Info("invalid topology data")
return framework.NewStatus(framework.Unschedulable, "invalid node topology data")
}
if nodeTopology == nil {
return nil
} |
This is how I did it in the noderesourcetopology plugin. The values (
Is something I find useful for debugging but is not universally accepted as good practice. Besides that IMO the general approach should look like that indeed. |
Thank you for your answer, it really helped me understand the background of this issue. |
/assign i will take this |
Area
Other components
No response
What happened?
k/k is migrating to contextual logging, we should also follow up to add more context when logging
kubernetes/enhancements#3077
What did you expect to happen?
use contextual logging
How can we reproduce it (as minimally and precisely as possible)?
No response
Anything else we need to know?
No response
Kubernetes version
Scheduler Plugins version
The text was updated successfully, but these errors were encountered: