-
Notifications
You must be signed in to change notification settings - Fork 300
[release-1.34] Migrate to contextual logging #9808
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.34] Migrate to contextual logging #9808
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 codebase from using klog directly to contextual logging through the pkg/log package. This is a cherry-pick of multiple logging migration changes (#9664, #9707, #9773, #9778) to the release-1.34 branch. The migration standardizes logging by replacing a mix of plaintext and structured logging with consistent contextual logging, improving clarity and observability across the codebase.
Key changes:
- Import statements changed from
k8s.io/klog/v2tosigs.k8s.io/cloud-provider-azure/pkg/log - Logger initialization using
log.Background().WithName(...)orlog.FromContextOrBackground(ctx).WithName(...) - Structured logging with key-value pairs instead of formatted strings
Reviewed changes
Copilot reviewed 63 out of 64 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/utils/kustoIngest.go | Migrates logging to contextual logger for Kusto ingestion utilities |
| tests/e2e/e2e_test.go | Updates test logging with contextual logger and proper error handling |
| pkg/windows/service/service.go | Converts Windows service logging to use contextual logger |
| pkg/util/node/node.go | Updates node utility logging with structured key-value pairs |
| pkg/util/controller/testutil/test_utils.go | Migrates fake node handler test utilities to contextual logging |
| pkg/util/controller/node/controller_utils.go | Updates node controller utilities with contextual logger |
| pkg/provider/subnet/subnet.go | Converts subnet repository logging to contextual approach |
| pkg/provider/storage/*.go | Migrates storage account and file service logging to structured format |
| pkg/provider/securitygroup/azure_securitygroup_repo.go | Updates security group repository logging |
| pkg/provider/azure_zones.go | Converts zone management logging to contextual logger |
| pkg/provider/azure_vmssflex*.go | Migrates VMSS Flex logging to structured key-value format |
| pkg/provider/azure_vmss*.go | Updates VMSS logging with contextual logger |
| pkg/provider/azure_standard.go | Converts availability set logging to contextual approach |
| pkg/provider/azure_utils.go | Updates utility function logging with structured format |
| pkg/provider/azure_routes.go | Migrates route management logging to contextual logger |
| pkg/provider/azure_publicip_repo.go | Updates public IP repository logging |
| pkg/provider/azure_privatelinkservice.go | Converts private link service logging to structured format |
| pkg/provider/azure_lock.go | Updates resource locking logging with contextual logger |
| pkg/provider/azure_local_services.go | Migrates local service logging to structured approach |
| pkg/provider/azure_loadbalancer*.go | Updates load balancer logging with contextual logger and key-value pairs |
| pkg/provider/azure_interface_repo.go | Converts network interface logging to contextual format |
| pkg/provider/azure_instances*.go | Migrates instance management logging to structured approach |
| pkg/provider/azure_instance_metadata.go | Updates metadata service logging with contextual logger |
| pkg/provider/azure_controller*.go | Converts controller logging to structured key-value format |
| pkg/nodeipam/node_ipam_controller.go | Updates node IPAM controller logging with proper error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/retest |
1 similar comment
|
/retest |
|
/retest |
1 similar comment
|
/retest |
|
/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 |
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.: