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

Persistent Volume Hourly Cost Metric #95

Closed
2 of 3 tasks
Pokom opened this issue Jan 30, 2024 · 4 comments
Closed
2 of 3 tasks

Persistent Volume Hourly Cost Metric #95

Pokom opened this issue Jan 30, 2024 · 4 comments

Comments

@Pokom
Copy link
Contributor

Pokom commented Jan 30, 2024

So far we've focused our efforts on exporting metrics for the following resources:

  • compute
  • blob storage

One metric distinctly missing is tracking the hourly cost for persistent volumes.
We would need two metrics:

  • Hourly Cost of Storage for the persistent volume (rate)
  • Amount(in GiB) allocated by the Persistent Volume Claim (usage)

These two metrics can then be joined together to calculate the total in spend (spend = usage * rate) for persistent volumes.

For both metrics, we need need the following labels:

  • persistentvolume - The name of the persistent volume
  • namespace - The namespace the pvc exists in
  • cluster - The cluster the pvc exists in
  • storage_class - Whether or not it's an SSD or HDD
  • location - The region the pvc lives in

Tasks

Preview Give feedback
  1. area/capacity
    paulajulve
@the-it
Copy link
Member

the-it commented Feb 7, 2024

Could we also just have one metric for each PVC, just cost per hour. If we need to scrape all PVCs, we also know there size, then we also know there total cost. Or is it somehow possible that a PVC is shared between namespaces?

@the-it
Copy link
Member

the-it commented Feb 7, 2024

  • next question is this part of the GKE module?

@Pokom
Copy link
Contributor Author

Pokom commented Feb 8, 2024

Could we also just have one metric for each PVC, just cost per hour. If we need to scrape all PVCs, we also know there size, then we also know there total cost. Or is it somehow possible that a PVC is shared between namespaces?

next question is this part of the GKE module?

I'll have a better answer to both questions once I start the implementation. It might end up being a dedicated module, but persistent volumes in particular are directly related to k8s resources so I think gke is where I'm going to start.

I like the notion of a single metric which takes into account exactly how much that pvc costs per hour as it simplifies things down stream in terms of queries. As long as there's no technical blocker, that's how I'll roll this out.

@Pokom Pokom self-assigned this Feb 22, 2024
Pokom added a commit that referenced this issue Mar 22, 2024
This implements a `ListDisks` method in `gke` that is then used to list out disks for the GKE projects by zone.
`ListDisks` will currently return a raw `compute.Disk` struct that is filtered by
2. Disks only associated with GKE clusters

- Relates to #95
@Pokom
Copy link
Contributor Author

Pokom commented Jul 9, 2024

Closing in favor of using existing issues. AWS is being implemented by @paulajulve(https://github.com/grafana/deployment_tools/issues/149203), and Azure still has to be planned out and picked up.

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

No branches or pull requests

3 participants