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

contextual logging blog post #32656

Merged

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Mar 30, 2022

kubernetes/enhancements#3077: contextual logging

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/blog Issues or PRs related to the Kubernetes Blog subproject labels Mar 30, 2022
@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Mar 30, 2022
@netlify
Copy link

netlify bot commented Mar 30, 2022

Pull request preview available for checking

Name Link
🔨 Latest commit 1ec1d50
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/62863195a49d7200092f75ed
😎 Deploy Preview https://deploy-preview-32656--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sftim sftim added this to Ready for review in Blog articles via automation Mar 30, 2022
@sftim sftim moved this from Ready for review to Planned in Blog articles Mar 30, 2022
@pohly pohly force-pushed the kubernetes-1.24-contextual-logging branch from 601b15b to dbf8925 Compare April 8, 2022 14:48
@pohly pohly changed the title WIP: contextual logging blog post contextual logging blog post Apr 8, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 8, 2022
@pohly
Copy link
Contributor Author

pohly commented Apr 8, 2022

The date and final title still needs to be decided.

Other than that the text is ready for review.

@pohly pohly force-pushed the kubernetes-1.24-contextual-logging branch from dbf8925 to a1c2aa1 Compare April 8, 2022 15:06
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 8, 2022
sftim
sftim previously requested changes Apr 10, 2022
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confident that we should actually publish this article under https://k8s.dev/blog/, and then mirror it to https://blog.k8s.io/

It should still be part of release comms but we'd also want to involve SIG Contributor Experience and make sure that we only publish the article on the right day.

@sftim sftim moved this from Planned to Requires update in Blog articles Apr 10, 2022
Code has to be modified to take advantage of contextual logging. The
traditional klog calls for logging continue to work unchanged but then don't
support contextual logging because output still goes through the global klog
logger. The [migration
Copy link

@pchan pchan Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration guide doesn't seem to have anything specific about contextual logging. I couldn't locate any specific text that dealt with deriving logger from Context or using APIs like FromName etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have mentioned that kubernetes/community#6560 needs to be merged first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pohly
Copy link
Contributor Author

pohly commented Apr 11, 2022

I'm confident that we should actually publish this article under https://k8s.dev/blog/,

It is indeed more targeted towards developers. Does that mean that I should move the post into a different PR? Where?

and then mirror it to https://blog.k8s.io/

Publishing it in both blogs makes sense, too. For example, I was only following the older blog.k8s.io but not k8s.dev/blog.

@sftim
Copy link
Contributor

sftim commented Apr 11, 2022

I would copy the article text into a PR that targets https://github.com/kubernetes/contributor-site

Please be sure to /hold that other PR in light of kubernetes/contributor-site#281

Then reference one PR from the other and we can get them published on the same day. Update this PR with a canonical URL in the front matter, that matches the expected URL of the primary blog once it publishes.
We can help you to get the puzzle pieces lined up.

@pohly
Copy link
Contributor Author

pohly commented Apr 11, 2022

Let's pick a date first. When do you want the two blog posts to get published?

Is the "contextual-logging" slug and title okay although the post also touches on progress with structured logging and mentions other klog enhancements?

The majority of the enhancements are for contextual logging and it makes for a more unique title compared to, say, "logging enhancements in Kubernetes in 1.24".

@pohly pohly force-pushed the kubernetes-1.24-contextual-logging branch from a1c2aa1 to 5565b4d Compare April 13, 2022 07:36
@sftim
Copy link
Contributor

sftim commented Apr 13, 2022

@mickeyboxell could you assign a tentative date? That will help @pohly move this work forward.

@sftim
Copy link
Contributor

sftim commented Apr 13, 2022

Is the "contextual-logging" slug and title okay although the post also touches on progress with structured logging and mentions other klog enhancements?

I think this kind of question is best posed on the other PR, so that folks from SIG ContribEx can help answer them. This PR should turn into just mirroring the text of the other PR, perhaps with minor changes.

@mickeyboxell
Copy link
Contributor

mickeyboxell commented Apr 13, 2022

@sftim Is there an official way for me to assign a date to a blog post other than suggesting an edit to the slug and blog title? I would like to aim to have a draft done by 26-April and release some time the following week.

@pohly
Copy link
Contributor Author

pohly commented Apr 28, 2022

I have copied the post into kubernetes/contributor-site#304 with the 2022-05-25 date and also updated it here.

@pohly pohly force-pushed the kubernetes-1.24-contextual-logging branch 2 times, most recently from 79febe3 to b2e9304 Compare April 28, 2022 13:53
Copy link
Contributor

@divya-mohan0209 divya-mohan0209 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial comments/suggestions. Hope you find them useful.


Before Kubernetes 1.24, some log calls in kube-scheduler still used `klog.Info`
for multi-line strings to avoid the unreadable output. Now kube-scheduler has
been converted completely to structured logging.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to say that kube-scheduler now implements structured logging? Or would it be using structured logging? I don't think convert is the right term here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log calls have been converted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've replace the last sentence with:

Now all log calls have been updated to support structured logging.


This enables additional use cases:

- The caller can attach a prefix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section as a whole is confusing. Are we intending to say that the caller can attach a prefix WithName and additional values from the WithValues prefix to the logger that it then passes into a function? Also, with the "and" in between do we imply that WithValues is necessary when we pass the WithName prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we intending to say that the caller can attach a prefix WithName and additional values from the WithValues prefix to the logger that it then passes into a function?

Yes.

Also, with the "and" in between do we imply that WithValues is necessary when we pass the WithName prefix?

No. That's an "and/or".

I've rewritten the first part of this use case.

pohly added a commit to pohly/contributor-site that referenced this pull request May 2, 2022
Contextual logging is an enhancement that landed as alpha in Kubernetes
1.24. Because it targets primarily developers of Kubernetes at this point,
publishing it under https://k8s.dev/blog on the same day as it also gets
published on the main blog (see
kubernetes/website#32656) makes sense.
@pohly
Copy link
Contributor Author

pohly commented May 2, 2022

@divya-mohan0209: let me take your suggestions over to kubernetes/contributor-site#304 and continue the discussion there. Otherwise I'll end up making changes to the same text in two different PRs 😢

pohly added a commit to pohly/contributor-site that referenced this pull request May 2, 2022
Contextual logging is an enhancement that landed as alpha in Kubernetes
1.24. Because it targets primarily developers of Kubernetes at this point,
publishing it under https://k8s.dev/blog on the same day as it also gets
published on the main blog (see
kubernetes/website#32656) makes sense.
pohly added a commit to pohly/contributor-site that referenced this pull request May 4, 2022
Contextual logging is an enhancement that landed as alpha in Kubernetes
1.24. Because it targets primarily developers of Kubernetes at this point,
publishing it under https://k8s.dev/blog on the same day as it also gets
published on the main blog (see
kubernetes/website#32656) makes sense.
@pohly
Copy link
Contributor Author

pohly commented May 5, 2022

/hold

Let's finalize kubernetes/contributor-site#304 first, then I'll update here.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2022
@sftim sftim dismissed their stale review May 11, 2022 17:00

Review was kind of stale

pohly added a commit to pohly/contributor-site that referenced this pull request May 12, 2022
Contextual logging is an enhancement that landed as alpha in Kubernetes
1.24. Because it targets primarily developers of Kubernetes at this point,
publishing it under https://k8s.dev/blog on the same day as it also gets
published on the main blog (see
kubernetes/website#32656) makes sense.
@pohly pohly force-pushed the kubernetes-1.24-contextual-logging branch from ab353d9 to 1ec1d50 Compare May 19, 2022 12:01
@pohly
Copy link
Contributor Author

pohly commented May 24, 2022

@sftim, @mickeyboxell: this needs to be merged by tomorrow to meet the publishing date.

I'll unhold kubernetes/contributor-site#304 tomorrow, so that blog post should go out on time.

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 24, 2022
@sftim sftim dismissed stale reviews from divya-mohan0209 and themself May 25, 2022 05:33

Review was stale

@sftim
Copy link
Contributor

sftim commented May 25, 2022

Thanks

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 25, 2022
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: ee127fbec872cf410dd2a429fbaab38a97dca619

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sftim

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 25, 2022
@k8s-ci-robot k8s-ci-robot merged commit e475891 into kubernetes:main May 25, 2022
Blog articles automation moved this from Requires update to Scheduled May 25, 2022
@sftim sftim moved this from Scheduled to Published in Blog articles May 25, 2022
fsmunoz pushed a commit to fsmunoz/contributor-site that referenced this pull request Dec 9, 2022
Contextual logging is an enhancement that landed as alpha in Kubernetes
1.24. Because it targets primarily developers of Kubernetes at this point,
publishing it under https://k8s.dev/blog on the same day as it also gets
published on the main blog (see
kubernetes/website#32656) makes sense.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/blog Issues or PRs related to the Kubernetes Blog subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Blog articles
Published
Development

Successfully merging this pull request may close these issues.

None yet

6 participants