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

support structured logging #1669

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

AiRanthem
Copy link
Member

Ⅰ. Describe what this PR does

Structured logging output is supported for the packages below:

  • pkg/daemon
  • pkg/webhook
  • pkg/util
  • cmd

Specifically, method calls similar to klog.Infof within these packages have been replaced with structured interfaces like klog.InfoS.

Ⅱ. Does this pull request fix one issue?

fixes #1551

Ⅲ. Describe how to verify it

Read the logs generated by Kruise.

Ⅳ. Special notes for reviews

PLZ do read every changes very carefully to ensure that they convey the same meaning as before.

@kruise-bot kruise-bot requested review from FillZpp and furykerry July 24, 2024 07:23
@kruise-bot
Copy link

Welcome @AiRanthem! It looks like this is your first PR to openkruise/kruise 🎉

@kruise-bot kruise-bot added the size/XL size/XL: 500-999 label Jul 24, 2024
@AiRanthem AiRanthem force-pushed the feature/structured_logging branch from 190126f to 2560f21 Compare July 24, 2024 07:31
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 31.39535% with 118 lines in your changes missing coverage. Please review.

Project coverage is 48.80%. Comparing base (0d0031a) to head (13c9399).
Report is 57 commits behind head on master.

Files Patch % Lines
pkg/util/workloadspread/workloadspread.go 50.00% 19 Missing ⚠️
pkg/util/inplaceupdate/inplace_update_defaults.go 22.22% 14 Missing ⚠️
pkg/daemon/criruntime/imageruntime/cri.go 0.00% 11 Missing ⚠️
pkg/webhook/pod/mutating/sidecarset.go 62.50% 9 Missing ⚠️
pkg/daemon/criruntime/imageruntime/docker.go 0.00% 8 Missing ⚠️
pkg/daemon/criruntime/imageruntime/pouch.go 0.00% 7 Missing ⚠️
pkg/daemon/podprobe/worker.go 12.50% 7 Missing ⚠️
pkg/daemon/podprobe/pod_probe_controller.go 50.00% 6 Missing ⚠️
pkg/webhook/pod/validating/workloadspread.go 0.00% 5 Missing ⚠️
pkg/daemon/criruntime/imageruntime/helpers.go 0.00% 3 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1669      +/-   ##
==========================================
+ Coverage   47.91%   48.80%   +0.88%     
==========================================
  Files         162      188      +26     
  Lines       23491    19278    -4213     
==========================================
- Hits        11256     9408    -1848     
+ Misses      11014     8639    -2375     
- Partials     1221     1231      +10     
Flag Coverage Δ
unittests 48.80% <31.39%> (+0.88%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/daemon/containermeta/container_meta_controller.go Outdated Show resolved Hide resolved
pkg/daemon/podprobe/pod_probe_controller.go Outdated Show resolved Hide resolved
pkg/util/inplaceupdate/inplace_update_defaults.go Outdated Show resolved Hide resolved
pkg/util/pods.go Outdated Show resolved Hide resolved
pkg/webhook/ingress/validating/ingress_handler.go Outdated Show resolved Hide resolved
pkg/webhook/pod/mutating/sidecarset.go Outdated Show resolved Hide resolved
pkg/webhook/server.go Outdated Show resolved Hide resolved
pkg/webhook/util/util.go Outdated Show resolved Hide resolved
@AiRanthem AiRanthem force-pushed the feature/structured_logging branch from 611b314 to b4f32bc Compare July 30, 2024 07:23
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
@AiRanthem AiRanthem force-pushed the feature/structured_logging branch from 064bc90 to 13c9399 Compare July 30, 2024 07:30
@furykerry
Copy link
Member

/lgtm
/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: furykerry

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

@kruise-bot kruise-bot merged commit 11e5ac0 into openkruise:master Jul 30, 2024
39 of 40 checks passed
@AiRanthem AiRanthem deleted the feature/structured_logging branch July 30, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] support structured logging
3 participants