Skip to content
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

Use structured logs #120

Closed
yuanchen8911 opened this issue Dec 3, 2020 · 35 comments · Fixed by #250 or #267
Closed

Use structured logs #120

yuanchen8911 opened this issue Dec 3, 2020 · 35 comments · Fixed by #250 or #267
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@yuanchen8911
Copy link
Member

yuanchen8911 commented Dec 3, 2020

Logging in Kubernetes 1.19 has been migrated to the structured format. Two new methods are added to k8s.io/klog/v2 library: InfoS and ErrorS. Should we update the scheduler plugins' logging calls to the structured logs and use the structured format in future logging?

Refs

@damemi
Copy link

damemi commented Dec 3, 2020

Yeah, this would be a good thing to work on. We've already done some work to switch our logs to structured in the descheduler too

@Huang-Wei
Copy link
Contributor

@yuanchen8911 SGTM. But before starting, it'd be good to have a document listing basic principles to guide developers how and when to use structural logging. Moreover, if we want to transfer to structural logging entirely, we'd better come up with a CI script to guard that as well.

BTW: I recalled @damemi raised an issue in k/k to improve logging, right?

@damemi
Copy link

damemi commented Dec 3, 2020

@Huang-Wei yep, that issue is here: kubernetes/kubernetes#91633

@seanmalloy
Copy link
Member

/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Dec 3, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 3, 2021
@seanmalloy
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 3, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 1, 2021
@seanmalloy
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 1, 2021
@JaneLiuL
Copy link
Member

Could I try to fix this issue as the good first issue that I can try to contribute to this gitrepository?
/assign

@Huang-Wei
Copy link
Contributor

Huang-Wei commented Aug 27, 2021

This issue needs help :)

I run a search across the codebase and separate the migration work evenly into 6 parts. If anyone is interested, just leave a comment below that which part you want to take:

(the number indicates the occurrences of klog in that file)

@Huang-Wei Huang-Wei added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Aug 27, 2021
@Huang-Wei
Copy link
Contributor

The structured logging KEP explains the motivation and internal details. And the migration doc is a practical guide to explain how to perform the migration.

@pravarag
Copy link
Contributor

I can take the Part 1 for the logging issue as mentioned above :)

@arvidOtt
Copy link
Contributor

I am working on part 2.

@CIPHERTron
Copy link
Member

I'm willing to take up Part 4 🙌🏻

@sayantani11
Copy link
Contributor

I'm willing to take part 3

@yharish991
Copy link
Contributor

i can take part 5

@Darshnadas
Copy link

I am willing to take part 6

@Huang-Wei
Copy link
Contributor

@Darshnadas Part 6 had an owner already :)

@Huang-Wei
Copy link
Contributor

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Sep 4, 2021
@k8s-ci-robot
Copy link
Contributor

@Huang-Wei: Reopened this issue.

In response to this:

/reopen

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.

@Darshnadas
Copy link

Yes, I did not notice it earlier. No issues :)

@jyz0309
Copy link

jyz0309 commented Sep 9, 2021

I am willing to take part 5. @Huang-Wei

@Huang-Wei
Copy link
Contributor

I am willing to take part 5. @Huang-Wei

it's claimed by @yharish991. @yharish991 are you still working part 5?

@jyz0309
Copy link

jyz0309 commented Sep 9, 2021

I am willing to take part 5. @Huang-Wei

it's claimed by @yharish991. @yharish991 are you still working part 5?

oh...I really sorry that I really have not noticed that. @yharish991 If you still work on this. I will close my PR.

@Huang-Wei
Copy link
Contributor

oh...I really sorry that I really have not noticed that.

That's no problem.

@yharish991 If you still work on this. I will close my PR.

Let's wait a couple of days (until this weekend). If he is not working on it, I will go review your PR.

@yharish991
Copy link
Contributor

@jyz0309 @Huang-Wei i'm almost done with this work, and was about to open a PR, but since @jyz0309 already opened a PR, let's review his PR :) I'm good with that :)

@jyz0309
Copy link

jyz0309 commented Sep 10, 2021

@jyz0309 @Huang-Wei i'm almost done with this work, and was about to open a PR, but since @jyz0309 already opened a PR, let's review his PR :) I'm good with that :)

No. Just open your PR. :) I have closed my PR.😉

@yharish991
Copy link
Contributor

@Huang-Wei opened the pr for part 5 #259

@pravarag
Copy link
Contributor

I'll be working on the CI script part as mentioned here in this comment: #120 (comment) .

@pravarag
Copy link
Contributor

@Huang-Wei @damemi few questions on adding the CI check for structured logging:

  1. The verify script will scan the diffs for the logging changes, if any. Is there a klog CLI which can be run during the job to verify the changes? Or is there any other way to filter for all the rules and structural changes in the commit.
  2. I'm guessing the ideal place to put the verify script will be this location:https://github.com/kubernetes-sigs/scheduler-plugins/tree/master/hack
  3. For tracking the progress, shall I continue in this issue itself or open a new issue for the same?

Any other suggestions you have which I can work on, please let me know 🙂

@Huang-Wei
Copy link
Contributor

Re 1: klog is more a SDK, so I don't think there is a CLI available. We don't need to get the changes in a commit. Instead, check the whole project. For sure, some folders like /vendor can be ignored. Ref: https://github.com/kubernetes/kubernetes/blob/master/hack/verify-gofmt.sh

Re 2: Nope, we should put it under <project>/hack/.

Re 3: Please open an new issue for tracking.

@pravarag
Copy link
Contributor

I've created the following issue: #261 for tracking further details/changes to it.

@Huang-Wei
Copy link
Contributor

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Oct 12, 2021
@k8s-ci-robot
Copy link
Contributor

@Huang-Wei: Reopened this issue.

In response to this:

/reopen

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.

@Huang-Wei
Copy link
Contributor

All items have been completed. Close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet