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

features: add ContextualLogging #32452

Merged
merged 1 commit into from Apr 6, 2022

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Mar 23, 2022

This is a new feature in 1.24. Only the infrastructure is going in at this
point with no changes in Kubernetes components, so the user-visible effect is
minimal.

@k8s-ci-robot k8s-ci-robot added this to the 1.24 milestone Mar 23, 2022
@netlify
Copy link

netlify bot commented Mar 23, 2022

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit 4a57c11
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/624b17f4aa02870008006846

@k8s-ci-robot k8s-ci-robot added 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. labels Mar 23, 2022
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Mar 23, 2022
@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Mar 23, 2022
@pohly
Copy link
Contributor Author

pohly commented Mar 23, 2022

/hold

Code PRs needs to be merged first.

@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 Mar 23, 2022
Comment on lines 742 to 743
use the [corresponding logging
calls](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/3077-contextual-logging#feature-gate).
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any documentation on https://k8s.dev/ about contextual logging? Ideally, we'd make sure that there was.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet, because it currently doesn't make a difference for end-users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See content/en/docs/concepts/cluster-administration/system-logs.md for an explanation based on the example command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, wrong site. For developers I have kubernetes/community#6560 pending. Should that document be moved to k8s.dev?

@sftim
Copy link
Contributor

sftim commented Mar 23, 2022

@pohly maybe what we should try to document is the format of logs when you select --logging-format=json as a cluster operator.

This feature gate is something we could mention on the page that describes that format, I think?

@sftim
Copy link
Contributor

sftim commented Mar 23, 2022

/sig instrumentation

@k8s-ci-robot k8s-ci-robot added the sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. label Mar 23, 2022
@mehabhalodiya
Copy link
Contributor

/assign @chrisnegus

@pohly
Copy link
Contributor Author

pohly commented Mar 24, 2022

maybe what we should try to document is the format of logs when you select --logging-format=json as a cluster operator.

This feature gate is something we could mention on the page that describes that format, I think?

The feature is independent of the output format.

@sftim
Copy link
Contributor

sftim commented Mar 24, 2022

Imagine a new reference page titled “Logging Output” or “Logging Formats”. Could we mention in that page the effect that this feature gate has on what output you get?

@pohly
Copy link
Contributor Author

pohly commented Mar 24, 2022

Imagine a new reference page titled “Logging Output” or “Logging Formats”. Could we mention in that page the effect that this feature gate has on what output you get?

Right now: none 😅 I could make something up, but that doesn't seem useful.

First some Kubernetes components must use the new infrastructure to extend their log output. kube-scheduler is likely to be the first candidate, but given that the infrastructure is going in late in the 1.24 cycle, those changes are probably not going to make the cut.

@pohly
Copy link
Contributor Author

pohly commented Apr 4, 2022

I remembered that I had extended the logging example so that it does contextual logging and has the --feature-gates parameter. I can use that as example in an overview section for the feature.

This is a new feature in 1.24. Only the infrastructure is going in at this
point with no changes in Kubernetes components, so the user-visible effect is
minimal.
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 4, 2022
@pohly
Copy link
Contributor Author

pohly commented Apr 4, 2022

/hold cancel

Code PRs were merged, this can get included in the 1.24 documentation now. I've also extended system-logs.md with information about the feature.

@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 Apr 4, 2022
@mehabhalodiya
Copy link
Contributor

enhancement ref: kubernetes/enhancements#3077

Copy link
Contributor

@chrisnegus chrisnegus left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d241ecaf57cefcc9e6b6786b3ead4a25c002d72d

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

tengqm commented Apr 6, 2022

/approve
Kicking this in since the mechanism is in place anyway.
Would like to see how structured/contextual logging behaves in each component.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tengqm

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 Apr 6, 2022
@k8s-ci-robot k8s-ci-robot merged commit fc771f4 into kubernetes:dev-1.24 Apr 6, 2022
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. 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. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants