Skip to content

chore: Add CSI-specific Prometheus metrics#2943

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
hccheng72:add-csi-metrics
Jan 25, 2026
Merged

chore: Add CSI-specific Prometheus metrics#2943
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
hccheng72:add-csi-metrics

Conversation

@hccheng72
Copy link
Copy Markdown
Contributor

@hccheng72 hccheng72 commented Jan 14, 2026

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR introduces dedicated CSI operation metrics for the AzureFile CSI driver, separate from the existing Azure cloud provider API metrics, enabling better observability of CSI operations.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 14, 2026
@k8s-ci-robot k8s-ci-robot requested review from cvvz and gnufied January 14, 2026 22:46
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 14, 2026
@k8s-ci-robot
Copy link
Copy Markdown
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 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 Jan 14, 2026
Copy link
Copy Markdown
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.

/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 Jan 15, 2026
@andyzhangx andyzhangx requested a review from Copilot January 15, 2026 02:39
Copy link
Copy Markdown

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

This PR introduces dedicated CSI-specific Prometheus metrics for the AzureFile CSI driver by creating a new metrics package (pkg/metrics), separate from the existing Azure cloud provider API metrics. The change enables better observability of CSI operations with operation-level tracking of duration and success rates.

Changes:

  • Added new pkg/metrics package with CSI-specific Prometheus metrics (histogram and counter)
  • Integrated new CSI metrics into controller server operations (CreateVolume, DeleteVolume, CreateSnapshot, DeleteSnapshot, ControllerExpandVolume)
  • Integrated new CSI metrics into node server operations (NodePublishVolume, NodeUnpublishVolume, NodeStageVolume, NodeUnstageVolume)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
pkg/metrics/metrics.go Defines CSI-specific Prometheus metrics with histogram and counter collectors, plus CSIMetricContext helper for tracking operation duration and success
pkg/metrics/metrics_test.go Comprehensive unit tests for the new metrics package including success/failure tracking, labeled metrics, and edge cases
pkg/azurefile/controllerserver.go Replaces cloud-provider metrics with new CSI metrics in controller operations; removes unused error check code
pkg/azurefile/nodeserver.go Adds CSI metrics tracking to node operations; maintains cloud-provider metrics for remaining operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 16, 2026
@andyzhangx andyzhangx requested a review from Copilot January 16, 2026 04:06
Copy link
Copy Markdown

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
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.

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 16, 2026
@hccheng72 hccheng72 force-pushed the add-csi-metrics branch 2 times, most recently from e0427f2 to 78e134c Compare January 21, 2026 18:22
@andyzhangx andyzhangx requested a review from Copilot January 22, 2026 02:07
Copy link
Copy Markdown

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
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 Jan 24, 2026
@k8s-ci-robot
Copy link
Copy Markdown
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 Jan 24, 2026
@andyzhangx
Copy link
Copy Markdown
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 25, 2026
@k8s-ci-robot k8s-ci-robot merged commit 1fdc64e into kubernetes-sigs:master Jan 25, 2026
22 checks passed
@andyzhangx
Copy link
Copy Markdown
Member

/cherrypick release-1.34

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@andyzhangx: new pull request created: #2946

Details

In response to this:

/cherrypick release-1.34

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/feature Categorizes issue or PR as related to a new feature. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants