[#271] Add namespace label to billing metrics #273
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#273
Loading…
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-s3-gw:feature/group_billing_metrics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Marina Biryukova m.biryukova@yadro.com
@ -19,4 +19,1 @@
type (
UsersStat interface {
Update(user, bucket, cnrID string, reqType int, in, out uint64)
}
Was it basically unused?
yes
Or we can extend this interface to use it in
stats
function and make*metrics.AppMetrics
to implement this interface. Though it leads to a little refactor to avoid cycle dependencies@ -129,11 +133,18 @@ func (u *UsersAPIStats) Update(user, bucket, cnrID string, reqType RequestType,
cid: cnrID,
Is it possible to keep namespace as a part of the key? Container IDs are unique across the system and every container has single namespace value. Maybe we can avoid additional
namespaceBucketStat
map then?Changed
c015e63463
to5d25820b18
@ -83,3 +79,3 @@
user := resolveUser(r.Context())
cnrID := resolveCID(r.Context(), reqInfo)
appMetrics.Update(user, reqInfo.BucketName, cnrID, requestTypeFromAPI(reqInfo.API), in.countBytes, out.countBytes)
appMetrics.Update(user, reqInfo.BucketName, cnrID, reqInfo.Namespace, requestTypeFromAPI(reqInfo.API), in.countBytes, out.countBytes)
Do we have to handle namespace alias? @alexvanin
Good catch. We definitely should.
5d25820b18
to93cf7c462b
LGTM