-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Fix cost calculations for AWS S3 #1053
feat: Fix cost calculations for AWS S3 #1053
Conversation
Signed-off-by: bishal7679 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've pushed 2 unwanted files: azure.svg & favicon.ico
storageCostPerGB = (sizeInTB * 1024) * 0.023 | ||
} else if sizeInTB <= 450 { | ||
monthlyCost = (sizeInTB * 1000) * 0.022 | ||
storageCostPerGB = (sizeInTB * 1024) * 0.022 | ||
} else { | ||
monthlyCost = (sizeInTB * 1000) * 0.021 | ||
storageCostPerGB = (sizeInTB * 1024) * 0.021 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace hardcoded values with actual values from pricing output similar to as you've done for requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's wrong with it as it covering 500 TB. When we are trying to fetch it using GetCost then it is giving $0 i.g its eliminating all the so small charges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can do it but you will unable to see so small amount like $0.00000011
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's taking free tier into account, if the free tier is described by the pricing output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you pls check once with my code by removing the static values and adding awsUtils.GetCost(priceMap["AWS-S3-Storage"]
dynamically with your AWS account??
and taking sizeinTB
into account
{ | ||
Field: aws.String("storageClass"), // Filter by storage class | ||
Value: aws.String("STANDARD"), // Specify the desired storage class | ||
Type: types.FilterTypeTermMatch, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different buckets might have different storage classes
}, | ||
{ | ||
Field: aws.String("storageClass"), // Filter by storage class | ||
Value: aws.String("STANDARD"), // Specify the desired storage class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make this dynamic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍
i dont understand! it's been taken automatically :( |
commit only the files you want to commit, son't commit all |
Problem #1022
Currently cost for AWS S3 is always showing as $0.
Solution
This PR is fixing that issue by adding more filters and usage metrics for request to s3 bucket with absolute pricemap fetching.
Changes Made
AmazonS3
service code and appropriate filters.Screenshots
Checklist