Feat/usage stats: First iteration of usage stats#303
Merged
Conversation
das-Abroxas
approved these changes
Jul 3, 2026
das-Abroxas
left a comment
Contributor
There was a problem hiding this comment.
Nice to have persistent usage accounting that makes storage consumption visible at both the node and group level. It will definitely be needed sooner rather than later, for example, when it comes to enforcing quotas. Approved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds maintained usage accounting for buckets, objects, stored blobs, stored bytes, and logical bytes. Counters are updated atomically in the S3 write transactions that change storage state, exposed through node and group usage endpoints, and rebuilt at startup for stores that predate the new counter keyspace.
Changes
usage_statskeyspace with serializedUsageCountersandUsageDeltastructs.UsageCounterUpdateoperation that read-modify-writes counters inside the host transaction.RebuildUsageStatsOperationto recompute counters from bucket, blob-location, object-head, and object-version keyspaces.GET /api/v1/info/usagefor node aggregate usage.GET /api/v1/groups/{id}/usagefor authenticated group members to read group usage.globalcounter if no sharded counters exist.GitHub Issues
Notes
stored_blobsandstored_bytesdescribe physical content-addressed blobs and are meaningful for global node usage.logical_bytessums materialized version sizes and is the per-group quota accounting basis.