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
Structured Logging migration:modify Scheduler part logs. #99273
Conversation
Hi @yangjunmyfm192085. 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. |
f8955cc
to
bcaac26
Compare
bcaac26
to
b740d7c
Compare
/ok-to-test |
/test pull-kubernetes-e2e-kind |
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.
I have seen many PR to address this simple issue, which are scattered here and there, is that better to make this fixed in one PR instead?
Good question. |
@@ -164,7 +164,7 @@ func applyFeatureGates(config *schedulerapi.Plugins) { | |||
if !utilfeature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) { | |||
// When feature is enabled, the default spreading is done by | |||
// PodTopologySpread plugin, which is enabled by default. | |||
klog.Infof("Registering SelectorSpread plugin") | |||
klog.InfoS("Registering SelectorSpread plugin") |
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.
Any difference here?
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.
Yeah,new Structured Logging migration uses InfoS.
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.
but for this case, I cannot see any benefit from the change, Infof
is still there.
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.
Yes,for this case,may not see the difference.But when there are variables, the format is different.
According to the following rules, Infof will be replaced by InfoS.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/1602-structured-logging
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.
couple of nits
pkg/scheduler/util/utils.go
Outdated
@@ -56,7 +56,7 @@ func GetPodStartTime(pod *v1.Pod) *metav1.Time { | |||
func GetEarliestPodStartTime(victims *extenderv1.Victims) *metav1.Time { | |||
if len(victims.Pods) == 0 { | |||
// should not reach here. | |||
klog.Errorf("victims.Pods is empty. Should not reach here.") | |||
klog.ErrorS(nil, "Victims.Pods is empty. Should not reach here.") |
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.
does this need to be changed? it's referring to a variable name here
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.
Any better suggestion?
According to structured Logging migration,Errorf needs to be converted to ErrorS.
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.
nvm, I'm fine with this
5a7155a
to
e54d9c6
Compare
/test pull-kubernetes-node-e2e-containerd |
/test pull-kubernetes-unit |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
138bf6f
to
dacf884
Compare
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.
/retest
dacf884
to
c5b404b
Compare
c5b404b
to
7a40cf4
Compare
7a40cf4
to
176efcc
Compare
@ahg-g, I have applied your suggestion. Could you take a look again? Thanks. |
/retest |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
176efcc
to
9304782
Compare
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.
It has been updated@ahg-g
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, yangjunmyfm192085 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 |
Signed-off-by: JunYang yang.jun22@zte.com.cn
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Structured Logging migration:modify Scheduler part logs.
xref:
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:
Fixes #
Special notes for your reviewer:
part of kubernetes/enhancements#1602
As it is related to log, change the log here to structured log.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: