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 generic_scheduler.go and types.go to structured logs #98134
Conversation
@tanjing2020: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @tanjing2020. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
e5bea41
to
ec8115c
Compare
5b752e3
to
6636100
Compare
Please check again, thank you. |
/ok-to-test |
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.
please revert all those file permission from 100755 -> 100644
and please fix bazel dependency issue as well. |
c70d54a
to
ce29376
Compare
/retest |
@@ -373,7 +371,7 @@ func (g *genericScheduler) prioritizeNodes( | |||
|
|||
if klog.V(10).Enabled() { | |||
for plugin, nodeScoreList := range scoresMap { | |||
klog.Infof("Plugin %s scores on %v/%v => %v", plugin, pod.Namespace, pod.Name, nodeScoreList) | |||
klog.InfoS("Plugin scored nodes for pod", "pod", klog.KObj(pod), "plugin", plugin, "nodeScoreList", nodeScoreList) |
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.
Extend this to a for loop, and have one line for each node, just like we do for extenders.
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.
Okey, I fixed it like this:
for _, nodeScore := range nodeScoreList {
klog.InfoS("Plugin scored node for pod", "pod", klog.KObj(pod), "plugin", plugin, "node", nodeScore.Name, "score", nodeScore.Score)
}
@@ -429,7 +427,7 @@ func (g *genericScheduler) prioritizeNodes( | |||
|
|||
if klog.V(10).Enabled() { | |||
for i := range result { | |||
klog.Infof("Host %s => Score %d", result[i].Name, result[i].Score) | |||
klog.InfoS("Combined (added) all scores together for that node", "node", result[i].Name, "score", result[i].Score) |
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.
"Calculated final score for node"
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.
Thanks, done.
b76f0fa
to
2417a02
Compare
/retest |
Linking to open issue: kubernetes/enhancements#1602 |
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.
/approve
@@ -429,7 +429,7 @@ func (g *genericScheduler) prioritizeNodes( | |||
|
|||
if klog.V(10).Enabled() { | |||
for i := range result { | |||
klog.Infof("Host %s => Score %d", result[i].Name, result[i].Score) | |||
klog.InfoS("Calculated final score for node", "node", result[i].Name, "score", result[i].Score) |
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.
Please add the pod. Sorry I missed this before.
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.
Done.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, tanjing2020 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2417a02
to
d59d107
Compare
/recc @alculquicondor @chendave |
/retest |
@alculquicondor 's comments has been addressed. /lgtm |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
/retest Review the full test history for this PR. Silence the bot with an |
2 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
@@ -562,7 +562,7 @@ func removeFromSlice(s []*PodInfo, k string) []*PodInfo { | |||
for i := range s { | |||
k2, err := GetPodKey(s[i].Pod) | |||
if err != nil { | |||
klog.Errorf("Cannot get pod key, err: %v", err) | |||
klog.ErrorS(err, "Cannot get pod key") |
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.
Add pod here and below
@tanjing2020 please submit a following up PR to address @alculquicondor 's comments, thanks! |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Ref:
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/1602-structured-logging
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md
Which issue(s) this PR fixes:
Verify log output (generic_scheduler.go):
Verify log output (types.go):
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: