-
Notifications
You must be signed in to change notification settings - Fork 300
[release-1.33] Migrate to contextual logging #9809
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
[release-1.33] Migrate to contextual logging #9809
Conversation
|
Hi @anndono. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the logging implementation from a mix of klog plaintext and structured logging to contextual logging using a new pkg/log package. This is a cherry-pick of multiple logging migration PRs (#9664, #9707, #9773, #9778) for the release-1.33 branch, aimed at standardizing logging, improving consistency, clarity, and observability across the codebase.
Key Changes
- Replaces
klogimports withsigs.k8s.io/cloud-provider-azure/pkg/log - Migrates from
klog.V().Info/Infof/Error/Errorf()to structured logging with key-value pairs - Introduces logger initialization with
log.Background().WithName()orlog.FromContextOrBackground(ctx).WithName()
Reviewed changes
Copilot reviewed 63 out of 64 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/utils/kustoIngest.go | Migrates KustoIngest function to use contextual logging with structured key-value pairs |
| tests/e2e/e2e_test.go | Updates test logging to use log package with proper error handling |
| pkg/windows/service/service.go | Converts Windows service logging to contextual logging |
| pkg/util/node/node.go | Updates node utility logging with structured format |
| pkg/util/controller/testutil/test_utils.go | Migrates test utilities to use contextual logging from context |
| pkg/util/controller/node/controller_utils.go | Updates controller utilities with structured logging |
| pkg/provider/subnet/subnet.go | Converts subnet operations logging to contextual logging |
| pkg/provider/storage/*.go | Migrates storage-related logging across multiple files |
| pkg/provider/securitygroup/*.go | Updates security group logging with structured format |
| pkg/provider/azure_*.go | Comprehensive migration of Azure provider logging across 30+ files |
| pkg/nodeipam/*.go | Updates node IPAM controller logging to use contextual logging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anndono, nilo19 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5ff3493
into
kubernetes-sigs:release-1.33
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Cherry pick of logging migration(#9664 , #9707 , #9773 , #9778 ): This standardizes logging by migrating from a mix of plaintext and structured logging to contextual logging, improving consistency, clarity, and observability across the codebase.
Which issue(s) this PR fixes:
Fixes #
ref: #1575
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: