Skip to content

chore: refactor metrics pkg#2972

Merged
andyzhangx merged 1 commit intokubernetes-sigs:masterfrom
hccheng72:refactor-metrics-pkg
Feb 18, 2026
Merged

chore: refactor metrics pkg#2972
andyzhangx merged 1 commit intokubernetes-sigs:masterfrom
hccheng72:refactor-metrics-pkg

Conversation

@hccheng72
Copy link
Contributor

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:

none

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 13, 2026
@k8s-ci-robot k8s-ci-robot requested review from cvvz and gnufied February 13, 2026 23:23
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 13, 2026
@andyzhangx
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 14, 2026
@andyzhangx andyzhangx requested a review from Copilot February 14, 2026 01:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CSIMetricContext with WithBasicVolumeInfo, WithAdditionalVolumeInfo, and WithLogLevel, 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.

@hccheng72 hccheng72 force-pushed the refactor-metrics-pkg branch from 56cb6a2 to 17f8642 Compare February 18, 2026 00:25
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 18, 2026
@k8s-ci-robot
Copy link
Contributor

[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

Details 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2026
@andyzhangx andyzhangx merged commit 9f28309 into kubernetes-sigs:master Feb 18, 2026
21 of 22 checks passed
@andyzhangx
Copy link
Member

/cherrypick release-1.35

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #2975

Details

In response to this:

/cherrypick release-1.35

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments