Skip to content

STAC-24557: Show backup sizes in victoria-metrics list command#26

Merged
viliakov merged 1 commit intomainfrom
STAC-24557
Apr 8, 2026
Merged

STAC-24557: Show backup sizes in victoria-metrics list command#26
viliakov merged 1 commit intomainfrom
STAC-24557

Conversation

@viliakov
Copy link
Copy Markdown
Contributor

@viliakov viliakov commented Apr 8, 2026

Summary

  • Add SIZE column to the victoria-metrics list command output
  • Calculate total backup size by summing all S3 objects in each backup directory (with pagination support)
  • Use existing output.FormatBytes() for human-readable size formatting (e.g., "977MiB")

Test plan

  • Run sts-backup victoria-metrics list and verify SIZE column appears
  • Verify sizes are displayed in human-readable format (B, KiB, MiB, GiB)
  • Verify behavior when backups have many objects (pagination)

@viliakov
Copy link
Copy Markdown
Contributor Author

viliakov commented Apr 8, 2026

❯ go run main.go victoria-metrics list --namespace stac-24557
Setting up port-forward to suse-observability-s3proxy:9000 in namespace stac-24557...
✅ Port-forward established on localhost:55760
Listing VictoriaMetrics backups in bucket ...

NOTE: In HA mode, backups from both instances (victoria-metrics-0 and victoria-metrics-1) are listed.
      The restore command accepts either backup to restore both instances.

NAME ({bucket}/{instance}-{created})                                                      UPDATED                  SIZE
sandbox-main-tenant-backup/stac-24557/victoria-metrics/victoria-metrics-1-latest          2026-04-08 08:35:10 UTC  1GiB
sandbox-main-tenant-backup/stac-24557/victoria-metrics/victoria-metrics-0-latest          2026-04-08 08:25:10 UTC  1GiB
sandbox-main-tenant-backup/stac-24557/victoria-metrics/victoria-metrics-0-20260408074122  2026-04-08 07:41:32 UTC  1GiB
sandbox-main-tenant-backup/stac-24557/victoria-metrics/victoria-metrics-0-20260408073312  2026-04-08 07:33:20 UTC  1GiB
sandbox-main-tenant-backup/stac-24557/victoria-metrics/victoria-metrics-0-20260408073240  2026-04-08 07:32:47 UTC  1GiB
sandbox-main-tenant-backup/stac-24557/victoria-metrics/victoria-metrics-1-20260403123500  2026-04-06 16:35:06 UTC  364MiB

@viliakov viliakov merged commit 8bf68fb into main Apr 8, 2026
5 checks passed
@viliakov viliakov deleted the STAC-24557 branch April 8, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants