Skip to content
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

Register metrics exposed by sig-storage-lib #792

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

RaunakShah
Copy link
Contributor

@RaunakShah RaunakShah commented Sep 28, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR registers metrics exposed by sig-storage-lib in the external provisioner.
After this change, querying the http endpoint includes the following metrics:

  1. Create an nginx pod in the cluster

  2. Get the IP address of the Pod running csi-provisioner

% kubectl get pod -o wide
NAME                   READY   STATUS    RESTARTS   AGE     IP            NODE              NOMINATED NODE   READINESS GATES
csi-hostpath-socat-0   1/1     Running   0          31h     10.244.1.6    csi-prow-worker   <none>           <none>
csi-hostpathplugin-0   8/8     Running   0          5h47m   10.244.1.23   csi-prow-worker   <none>           <none>
nginx                  1/1     Running   0          9h      10.244.1.18   csi-prow-worker   <none>           <none>
  1. Exec into the nginx pod and curl the metrics endpoint
% kubectl exec -it nginx -- sh
# curl 10.244.1.23:8080/metrics
# HELP controller_persistentvolume_delete_duration_seconds Latency in seconds to delete persistent volumes. Failed deletion attempts are ignored. Broken down by storage class name.
# TYPE controller_persistentvolume_delete_duration_seconds histogram
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="0.005"} 0
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="0.01"} 0
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="0.025"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="0.05"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="0.1"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="0.25"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="0.5"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="1"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="2.5"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="5"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="10"} 1
controller_persistentvolume_delete_duration_seconds_bucket{class="csi-hostpath-sc",le="+Inf"} 1
controller_persistentvolume_delete_duration_seconds_sum{class="csi-hostpath-sc"} 0.011995
controller_persistentvolume_delete_duration_seconds_count{class="csi-hostpath-sc"} 1
# HELP controller_persistentvolume_delete_total Total number of persistent volumes deleted succesfully. Broken down by storage class name.
# TYPE controller_persistentvolume_delete_total counter
controller_persistentvolume_delete_total{class="csi-hostpath-sc"} 1
# HELP controller_persistentvolumeclaim_provision_duration_seconds Latency in seconds to provision persistent volumes. Failed provisioning attempts are ignored. Broken down by storage class name.
# TYPE controller_persistentvolumeclaim_provision_duration_seconds histogram
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="0.005"} 0
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="0.01"} 0
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="0.025"} 0
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="0.05"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="0.1"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="0.25"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="0.5"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="1"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="2.5"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="5"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="10"} 1
controller_persistentvolumeclaim_provision_duration_seconds_bucket{class="csi-hostpath-sc",le="+Inf"} 1
controller_persistentvolumeclaim_provision_duration_seconds_sum{class="csi-hostpath-sc"} 0.032850625
controller_persistentvolumeclaim_provision_duration_seconds_count{class="csi-hostpath-sc"} 1
# HELP controller_persistentvolumeclaim_provision_total Total number of persistent volumes provisioned succesfully. Broken down by storage class name.
# TYPE controller_persistentvolumeclaim_provision_total counter
controller_persistentvolumeclaim_provision_total{class="csi-hostpath-sc"} 1
...

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Register metrics exposed by sig-storage-lib

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 28, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 28, 2022
@xing-yang
Copy link
Contributor

In the output, please also include the command you run that generated the results.

@xing-yang xing-yang self-assigned this Sep 28, 2022
@xing-yang
Copy link
Contributor

/assign @jsafrane

@RaunakShah
Copy link
Contributor Author

In the output, please also include the command you run that generated the results.

Done, added the exact test steps!

@jsafrane
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, RaunakShah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants