Skip to content

Commit

Permalink
Adjust instanceID for objectStorage to ensure uniqueness
Browse files Browse the repository at this point in the history
the instanceID must be unique in a single SO. Since objectstorage is
billed on multiple metrics (storage, requests and trafficout) we need to
adjust the instanceID to ensure it's unique for all metrics.

Signed-off-by: Nicolas Bigler <nicolas.bigler@vshn.ch>
  • Loading branch information
TheBigLee committed Dec 28, 2023
1 parent e0800f7 commit 65e2a44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/cloudscale/objectstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (o *ObjectStorage) createOdooRecord(bucketMetricsData cloudscale.BucketMetr
return []odoo.OdooMeteredBillingRecord{
{
ProductID: productIdStorage,
InstanceID: instanceId,
InstanceID: instanceId + "/storage",
ItemDescription: bucketMetricsData.Subject.BucketName,
ItemGroupDescription: itemGroup,
SalesOrder: salesOrder,
Expand All @@ -150,7 +150,7 @@ func (o *ObjectStorage) createOdooRecord(bucketMetricsData cloudscale.BucketMetr
},
{
ProductID: productIdTrafficOut,
InstanceID: instanceId,
InstanceID: instanceId + "/trafficout",
ItemDescription: bucketMetricsData.Subject.BucketName,
ItemGroupDescription: itemGroup,
SalesOrder: salesOrder,
Expand All @@ -163,7 +163,7 @@ func (o *ObjectStorage) createOdooRecord(bucketMetricsData cloudscale.BucketMetr
},
{
ProductID: productIdQueryRequests,
InstanceID: instanceId,
InstanceID: instanceId + "/requests",
ItemDescription: bucketMetricsData.Subject.BucketName,
ItemGroupDescription: itemGroup,
SalesOrder: salesOrder,
Expand Down
2 changes: 1 addition & 1 deletion pkg/exoscale/objectstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (o *ObjectStorage) getOdooMeteredBillingRecords(ctx context.Context, sosBuc

o := odoo.OdooMeteredBillingRecord{
ProductID: productIdStorage,
InstanceID: instanceId,
InstanceID: instanceId + "/storage",
ItemDescription: bucketDetail.BucketName,
ItemGroupDescription: itemGroup,
SalesOrder: salesOrder,
Expand Down

0 comments on commit 65e2a44

Please sign in to comment.