-
Sub-task
-
Resolution: Done
-
Normal
-
None
-
None
-
None
-
1
-
False
-
None
-
False
-
-
It looks like the usage of of compute instance items with SavingsPlanCoveredUsage are duplicated due to the fact that the AWS CUR contains also SavingsPlanNegation line items and these line items are reported with the same lineItem/UsageAmount as the corresponding SavingsPlan line items.
Consequently, the customers with AWS savings plan will see incorrect instance usage in Overview AWS UI page - Compute (EC2) instances usage graph and on AWS instance-type API endpoint
Steps to reproduce:
1. ingest real aws cost report containing compute instances with SavingsPlanCoveredUsage and SavingsPlanNegation line items (you can use this report as an example -> make sure to update dates in the report to the current or previous month before the ingest!: https://drive.google.com/file/d/1OmlK8qiBB07yWA9Te9nFhdGtprwiAZoB/view?usp=drive_link
2. check http://localhost:8000/api/cost-management/v1/reports/aws/instance-types/
with appropriate start_date/end_date params
you will see that instance usage is duplicated for savingsplan instances. In the case of the example report, the total usage is 218.0 Hrs instead of expected 109 Hours (the expected usage is the sum of lineItem/UsageAmount of all Usage or SavingsPlanCoveredUsage Compute instances from the CUR)
"total": { "usage": { "value": 218.0, "units": "Hrs" }, "infrastructure": {...}, "supplementary": {...}, "cost": { "... "total": { "value": 0.0, "units": "USD" } } }