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

Support for VolumeSnapshot metrics #2489

Open
mnacharov opened this issue Aug 30, 2024 · 2 comments
Open

Support for VolumeSnapshot metrics #2489

mnacharov opened this issue Aug 30, 2024 · 2 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@mnacharov
Copy link

What would you like to be added:

Expose metrics for VolumeSnapshot and VolumeSnapshotContent objects:
https://kubernetes.io/docs/concepts/storage/volume-snapshots/
they are available since kubernetes v1.20

Why is this needed:

To see current ReadyToUse status of these resources and have alert when ReadyToUse==false too long

Describe the solution you'd like

Implement new metrics in addition to current docs/metrics/storage metrics

Additional context

@mnacharov mnacharov added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 30, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 30, 2024
@dashpole
Copy link
Contributor

dashpole commented Sep 5, 2024

/assign @dgrisonnet
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 5, 2024
@mweibel
Copy link

mweibel commented Nov 21, 2024

I'm +1 on that though I'm not sure how the policy of kube-state-metrics is regarding these kind of resources since it's a custom resource and AFAIK not always installed.

To work around not having it, you can also declare it as a custom resource to scrape by kube-state-metrics:

Example when using helm:

rbac:
  extraRules:
    - apiGroups:
        - "snapshot.storage.k8s.io"
      resources:
        - volumesnapshots
      verbs:
        - get
        - list
        - watch
    - apiGroups:
        - "snapshot.storage.k8s.io"
      resources:
        - volumesnapshots/status
      verbs:
        - get
customResourceState:
  enabled: true
  # Add (Cluster)Role permissions to list/watch the customResources defined in the config to rbac.extraRules
  config:
    spec:
      resources:
        - groupVersionKind:
            group: snapshot.storage.k8s.io
            version: "v1"
            kind: VolumeSnapshot
          labelsFromPath:
            name: [metadata, name]
          metrics:
            - name: volumesnapshot_info
              help: "Information about volumesnapshot"
              each:
                type: Info
                info:
                  labelsFromPath:
                    readyToUse: [status, readyToUse]
                    restoreSize: [status, restoreSize]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants