[#271] Add namespace label to billing metrics #273

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-s3-gw:feature/group_billing_metrics into master 2023-12-05 06:41:21 +00:00
Member

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2023-12-01 11:52:45 +00:00
mbiryukova requested review from storage-services-committers 2023-12-01 11:57:40 +00:00
mbiryukova requested review from storage-services-developers 2023-12-01 11:57:40 +00:00
alexvanin reviewed 2023-12-01 12:38:25 +00:00
@ -19,4 +19,1 @@
type (
UsersStat interface {
Update(user, bucket, cnrID string, reqType int, in, out uint64)
}
Owner

Was it basically unused?

Was it basically unused?
Author
Member

yes

yes
Member

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

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
dkirillov marked this conversation as resolved
@ -129,11 +133,18 @@ func (u *UsersAPIStats) Update(user, bucket, cnrID string, reqType RequestType,
cid: cnrID,
Owner

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?

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?
Author
Member

Changed

Changed
alexvanin marked this conversation as resolved
mbiryukova force-pushed feature/group_billing_metrics from c015e63463 to 5d25820b18 2023-12-01 15:04:45 +00:00 Compare
dkirillov reviewed 2023-12-04 06:33:51 +00:00
@ -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)
Member

Do we have to handle namespace alias? @alexvanin

Do we have to handle namespace alias? @alexvanin
Owner

Good catch. We definitely should.

Good catch. We definitely should.
dkirillov marked this conversation as resolved
mbiryukova force-pushed feature/group_billing_metrics from 5d25820b18 to 93cf7c462b 2023-12-04 12:03:12 +00:00 Compare
dkirillov approved these changes 2023-12-04 12:19:06 +00:00
dkirillov left a comment
Member

LGTM

LGTM
alexvanin approved these changes 2023-12-05 06:41:12 +00:00
alexvanin merged commit 93cf7c462b into master 2023-12-05 06:41:21 +00:00
alexvanin deleted branch feature/group_billing_metrics 2023-12-05 06:41:22 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#273
No description provided.