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 '-group-by' flag to compute aggregated disk usage #48

Closed fedordikarev closed 1 year ago

fedordikarev commented 1 year ago

Draft on how "Group by" functionality could be added.

Example output:

> unused -gcp.project dev-project -group-by kubernetes.io/created-for/pvc/namespace
PROVIDER  GROUP_BY                         TYPE    SIZE_GB
GCP       agent-smoke-test                 ssd     30
GCP       default                          hdd     941
GCP       preview                          ssd     120
GCP       NONE                             ssd     1000
GCP       ge-logs                          hdd     5
...

> unused -gcp.project dev-project -group-by zone
PROVIDER  GROUP_BY       TYPE    SIZE_GB
GCP       us-central1-a  ssd     56370
GCP       us-central1-a  hdd     4340
GCP       us-central1-b  ssd     10528
GCP       us-central1-f  ssd     6188
GCP       us-central1-f  hdd     451
GCP       us-central1-b  hdd     1150
fedordikarev commented 1 year ago

thanks @inkel , addressed all your comments :)