chore: refactor metrics pkg#2972
Conversation
|
Hi @hccheng72. Thanks for your PR. I'm waiting for a kubernetes-sigs 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.
Pull request overview
Refactors the CSI metrics package to standardize label keys, add structured latency logging context (volume-related key/value pairs), and updates Azure File CSI controller/node code to use the refactored metrics context for more consistent latency logs across drivers.
Changes:
- Extend
CSIMetricContextwithWithBasicVolumeInfo,WithAdditionalVolumeInfo, andWithLogLevel, plus structured latency logging. - Replace hard-coded metric label keys with exported constants (
Protocol,StorageAccountType). - Update Azure File controller/node operations and metrics unit tests/benchmarks to use the new context APIs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| pkg/metrics/metrics.go | Adds volume context + log level to metric context and emits structured latency logs; introduces label key constants. |
| pkg/metrics/metrics_test.go | Updates tests to use basic volume info + label constants; adds tests for new APIs; adjusts timing test/benchmarks. |
| pkg/azurefile/nodeserver.go | Switches Node* operations to use pkg/metrics CSI context and adds volume info to latency logs. |
| pkg/azurefile/controllerserver.go | Switches controller operations to CSI context (incl. protocol/account-type labels) and removes dependency on cloud-provider-azure metrics for these paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
56cb6a2 to
17f8642
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, hccheng72 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 |
|
/cherrypick release-1.35 |
|
@andyzhangx: new pull request created: #2975 DetailsIn 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-sigs/prow repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Refactoring metrics package for consistency across csi drivers.
Which issue(s) this PR fixes:
Unify latency log format across csi drivers with the change in the blob driver kubernetes-sigs/blob-csi-driver#2326
Fixes #
Requirements:
Special notes for your reviewer:
Release note: