You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like for the Kubernetes community to settle on one preferred log message structure, that will be enforced by new klog methods. The goal of the migration is to switch C like format string logs to structured logs with explicit metadata about parameters.
15
+
16
+
Migration within the structured logging working group happens in two different ways - organized & non-organized.
17
+
18
+
With organized, milestone-based, large-scale migration we try to target deliverables for a specific Kubernetes release. A good example of such an effort is the migration of the entire Kubelet code in the [#1.21 release](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.21.md#structured-logging-in-kubelet)
19
+
20
+
For non-organized migrations, the onus is, generally, on the individual contributors.
21
+
22
+
* Organized Migration
23
+
24
+
Organized migration is carried out in a two state cycle aligning with the cadence of Kubernetes releases.
25
+
26
+
In the first stage, we pick a particular migration milestone & create an issue to split the work into smaller chunks (for example, migrating just a single file). This ensures that the work can be easily picked up by multiple individual contributors and also avoids conflicts. After the migration activity is complete, we mark the directory as migrated to avoid regressions with the help of tooling that we have developed.
27
+
28
+
In the second milestone, we take a break from migration to analyze results & improve our existing processes. Adding structured information to logs is a very costly & time-consuming affair. Setting aside time in the second stage to collect feedback, analyze the impact of changes on the log volume & performance, and better our PR review process helps us avoid mistakes and duplicate efforts.
29
+
30
+
* Non-organized migration
31
+
32
+
As aforementioned, our non-organized migration efforts are spearheaded by individual contributors who need to migrate particular code sections to utilize new features early.
33
+
34
+
Efforts for Kubernetes components not yet marked for migration also fall under this category & we will try our best to review and accept as many PRs as we can, but being a small team, we can't give any time frames for the same.
35
+
36
+
The respective component owners have a final say in the acceptance of these contributions. Since this is a non-organized effort there is a high possibility that two contributors could be working on migrating the same code.
37
+
38
+
Before sending a PR our way, please ensure that there isn't one already in place created by someone else.
39
+
40
+
### Current status
41
+
42
+
* 1.21 Kubelet was migrated
43
+
* 1.22 We are collecting feedback and making improvements to the migration process.
44
+
45
+
## Sending a Structured Logging Migration Pull Request
46
+
47
+
### Before creating the Pull Request
48
+
49
+
* In case of any questions, please contact us on [#wg-structured-logging](https://kubernetes.slack.com/messages/wg-structured-logging) Slack channel.
50
+
* Check list of [opened PRs](https://github.com/kubernetes/kubernetes/pulls?q=is%3Aopen+label%3Awg%2Fstructured-logging+is%3Apr) to understand if someone is already working on this.
To ensure that the PRs are reviewed in a timely manner, we require authors to provide the below information. This helps in proper triaging & reviewing by the concerned knowledgeable parties.
56
+
57
+
* title: `Migrate <directory/file> to structured logging`
58
+
* WGs: `structured-logging`
59
+
* area: `logging`
60
+
* priority: `important-longterm` for normal PR or `important-soon` for PRs that are part of organized migration of component.
61
+
* cc: @kubernetes/wg-structured-logging-reviews
62
+
* kind: cleanup
63
+
* release note: `Migrate <directory/file> to structured logging
64
+
`
65
+
To quickly add this information you can comment on PR with below commands:
66
+
67
+
```
68
+
/retitle Migrate <directory/file> to structured logging
69
+
/wg structured-logging
70
+
/area logging
71
+
/priority important-longterm
72
+
/kind cleanup
73
+
/cc @kubernetes/wg-structured-logging-reviews
74
+
```
75
+
And edit the top comment to include release note:
76
+
Migrate <directory/file> to structured logging
77
+
78
+
### Why my PR was rejected?
79
+
80
+
Even though the Kubernetes project is organizing migration of Structured Logging, this doesn't mean that we are able to accept all the PRs that come our way. We reserve the right to reject the Pull Request in situations listed below:
81
+
82
+
* Pull request is below minimum quality standards and clearly shows that author hasn't read the guide at all, for example PR just renames `Infof` to `InfoS`.
83
+
* Pull request migrates components that the owners have decided against migrating. List of those components:
84
+
* kubeadm
85
+
86
+
87
+
10
88
## Goal of Alpha migration
11
89
12
90
The first step is to introduce structure to the high percentage of logs generated in Kubernetes by changing only a
0 commit comments