grafana / unused

CLI tool, Prometheus exporter, and Go module to list your unused disks in all cloud providers
Apache License 2.0
51 stars 1 forks source link

Add metric for disk info & last update #83

Closed dannykopping closed 5 months ago

dannykopping commented 5 months ago

This PR adds a unused_disks_last_used_at metric which exports the disk, PVC, and PV identifiers. The value of the gauge is the last time the disk was mounted (although this is only available on GCP for now).

I want to use this metric to create an alert for a PVC which exists without its underlying disk/volume, which happened to my team recently when we ran a script to cleanup unused disks (but it didn't clean up the associated PVCs).

To my knowledge, neither opencost nor kube-state-metrics export a metric which allows 3-way correlation between PVCs, PVs, and their underlying disks.

dannykopping commented 5 months ago

Thanks @fedordikarev Do we need anyone else's approval before we merge?

fedordikarev commented 5 months ago

@dannykopping one review was enough for the past PRs from what I see on changes:

we may wait for @inkel review as he is initial author of the tool and introduced structure for code and modules.

dannykopping commented 5 months ago

@inkel @Pokom please have another look; I've addressed your comments

inkel commented 5 months ago

Thank you for your contribution, @dannykopping!