Discussion about dropping klog legacy features. What logging features should be supported?

138 views
Skip to first unread message

Marek Siarkowicz

unread,
Jun 21, 2021, 2:48:05 PM6/21/21
to kuberne...@googlegroups.com, kubernetes-sig-instrumentation, kubernetes-wg-st...@googlegroups.com
Hey kubernetes-dev, sig-instrumentation, wg-structured-logging

In v1.19 Kubernetes added an alternative to klog output format, the JSON logging format. It's faster and easier to parse. However it was lacking some klog features that we got used to, it didn't add the information about source code that called the logger and only supported one (-v) out of 13 klog configuration flags. To make user experience comparable with klog, we specified  that reaching feature parity should be a Beta requirement.

In v1.22 JSON formats will include the source code information under the "caller" key, but we can't implement support for all of the klog flags. Implementing features that are not actively utilized by community doesn't make sense, therefore I send this email to ask the community about what features are important to you.

Within the Structured Logging working group we have already started a discussion about what to do with the legacy klog flags. I have created a proposal to deprecate and in future hide subset of klog flags from K8s core components (kube-apiserver, kube-scheduler, kube-controller-manager, kubelet). We scope the changes to only those components a so as not to impact the broader klog community. As a result we would remove features like:
* Writing logs to files
* Log file rotation
* Adding/Removing klog headers
* Adding stacktrace at the specific location

I'm open to discussion about keeping some of those features, but most of them seem klog specific or do not comply with best logging practices like writing to stdout/stderr.

Please let me know what you think on the issue https://github.com/kubernetes/kubernetes/issues/99270. Please let me know if this is worthy of a dedicated KEP.

Thanks

Marek Siarkowicz

unread,
Jun 28, 2021, 5:05:40 AM6/28/21
to kuberne...@googlegroups.com, kubernetes-sig-instrumentation, kubernetes-sig-architecture, kubernetes-wg-st...@googlegroups.com
+kubernetes-sig-architecture CC to bring the discussion to SIG Arch

siark...@google.com

unread,
Jul 30, 2021, 8:31:38 AM7/30/21
to Kubernetes developer/contributor discussion
Hey wanted to update this thread with discussion from SIG arch.

There is a high level support for this proposal. I'm planning to create a KEP for 1.23

Notes from the meeting:
  • Proposal has two things to consider:

    • Remove flags from k8s components

    • Remove flags from klog

    • (We could also do both)

  • Klog wasn’t intended to be an all-purpose logging library, but it ended up becoming one and now has widespread community usage

  • V1 -> v2 migration was extremely painful, and probably would be worse for a v2 -> v3

  • Klog was forked from glog and ended up supporting all its flags by default, wasn’t really deliberate

  • Move forward:

    • Propose sane defaults, 

    • Cleaning up the output stream flags first for k8s binaries

    • Then clean up file-specific flags

    • Punt the klog-specific changes down the road

Davanum Srinivas

unread,
Jul 30, 2021, 9:01:11 AM7/30/21
to siark...@google.com, Kubernetes developer/contributor discussion
More power to you! Looking forward to the KEP.

-- Dims

--
You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/d6692cf8-b1b1-4825-9310-da71c46b3a04n%40googlegroups.com.


--
Davanum Srinivas :: https://twitter.com/dims

Marek Siarkowicz

unread,
Aug 2, 2021, 5:24:06 AM8/2/21
to Davanum Srinivas, kubernetes-wg-st...@googlegroups.com, Kubernetes developer/contributor discussion
Reply all
Reply to author
Forward
0 new messages