-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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 text output: handle arbitrary values #106428
Comments
/sig instrumentation |
Log ingestion written for the traditional klog output format will not handle this correctly, for example https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/fluentd-elasticsearch/fluentd-es-configmap.yaml#L234 When using We need a similar solution for |
/triage accepted |
We have this problem in kubelet. With the benchmark + log analysis tool from #106594 I found the following struct parameters with embedded multi-line strings in a kubelet log:
Update: this value is logged as a string in the JSON output. That's odd, the original value is a |
/assign Fixed in klog. I'll make sure to get klog released and import it into Kubernetes. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The klog release with the fix is in Kubernetes 1.24. /close |
@pohly: Closing this issue. In response to this:
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. |
What happened?
The
klog.InfoS
output was meant to machine readable. In particular it should be possible to split the log output into individual messages.The argument in kubernetes/klog#268 (comment) was that the klog header can be used to split the output, the same way as current log parsers already do it (backwards compatibility).
That approach does not work when a struct gets logged as value in a key/value pair and that struct contains multi-line data which contains klog headers.
What did you expect to happen?
One of the following would solve the problem:
How can we reproduce it (as minimally and precisely as possible)?
This currently prints:
Anything else we need to know?
IMHO text output does not need to be machine-readable, so I favor the third solution because it also addresses #104868 without reverting to non-structured logging.
Kubernetes version
1.23 and older
Cloud provider
n/a
OS version
No response
Install tools
n/a
Container runtime (CRI) and and version (if applicable)
No response
Related plugins (CNI, CSI, ...) and versions (if applicable)
No response
The text was updated successfully, but these errors were encountered: