Skip to content
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 Calculation for AWS CloudFront Distributions & Functions #1123

Conversation

bishal7679
Copy link
Contributor

@bishal7679 bishal7679 commented Oct 21, 2023

Problem #877

Currently, cost for AWS CloudFront is full static and showing wrong.

Solution

This PR is fixing that issue by adding more metrics for lambda-edge-duration, lambda-edge-requests, origin-shield-request with pricemap fetching.

Changes Made

  • Fetching price info using AWS SDK price module using AmazonCloudFront service code and appropriate filters.
  • getting price map using util function GetPriceMap from utils.go
  • fetching distribution objects & function objects using CloudFront client
  • also fetching lambda-edge-duration, lambda-edge-requests, origin-shield-request metrics using CloudWatch
  • Finally added dynamic calculation as per all the metrics

Checklist

  • Code follows the contributing guidelines
  • Changes have been thoroughly tested
  • Documentation has been updated, if necessary
  • Any dependencies have been added to the project, if necessary

Pricingoutput :-
pricing.json

REF :- #1083

Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
@AvineshTripathi
Copy link
Collaborator

Hey @bishal7679 I think their is some unresolved path issue from frontend, maybe rebase issue or something to do with git can you check

Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
@bishal7679
Copy link
Contributor Author

bishal7679 commented Oct 22, 2023

@AvineshTripathi @mlabouardy I tried a lot to fix this linting issue but weirdly it is throwing error that useToast is not there or importing issue
I am unable to fix it 😿
And i can see there is no hooks folder for @components/toast/hooks/useToast which is importing useToast

@AvineshTripathi
Copy link
Collaborator

@AvineshTripathi @mlabouardy I tried a lot to fix this linting issue but weirdly it is throwing error that useToast is not there or importing issue I am unable to fix it 😿 And i can see there is no hooks folder for @components/toast/hooks/useToast which is importing useToast

Ya there is some weird behaviour recently, I see the same error for #1125

@Traxmaxx
Copy link
Contributor

@AvineshTripathi I have a fix in my PR. It is the result of a previous merge conflict.

@bishal7679 bishal7679 closed this Oct 23, 2023
@bishal7679 bishal7679 deleted the feature/correct-cost-for-cloudfront branch October 23, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants