-
Notifications
You must be signed in to change notification settings - Fork 169
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
Different RDS values when comparing AWS Cost Explorer and Optscale Cost Explorer #62
Comments
Hello, Did you check network traffic ? Thomas. |
Hello, |
Hello, I made a deep analysis on the cost difference. Some point:
Based on the optscale API /raw_expenses I made a external script using a rewrite version of this parser: optscale/diworker/diworker/importers/aws.py Line 565 in 52ca25d
As: def clean_expenses_for_resource(resource_id, expenses, ):
clean_expenses = {}
edp = "YOUR EDP VALUE: Eg 0.05"
for e in expenses:
start_date = _datetime_from_expense(e, 'lineItem/UsageStartDate')
end_date = _datetime_from_expense(e, 'lineItem/UsageEndDate')
# end date may point to the 00:00 on the next day,
# so to avoid confusion removing one second
end_date -= timedelta(seconds=1)
days = (end_date - start_date).days + 1
for d in range(days):
date = start_date + timedelta(days=d)
day = date.replace(hour=0, minute=0, second=0, microsecond=0).timestamp()
if day in clean_expenses:
if 'discount/EdpDiscount' in e and 'lineItem/BlendedCost' in e:
clean_expenses[day]['discount'] += float(e['lineItem/BlendedCost']) * edp / days
clean_expenses[day]['cost'] += float(e['lineItem/BlendedCost']) / days
else:
clean_expenses[day]['cost'] += float(e['cost']) / days
else:
if 'discount/EdpDiscount' in e and 'lineItem/BlendedCost' in e:
discount = float(e['lineItem/BlendedCost']) * edp / days
cost = float(e['lineItem/BlendedCost']) / days
else:
discount = 0.0
cost = float(e['cost']) / days
clean_expenses[day] = {
'discount': discount,
'date': day,
'cost': cost,
'resource_id': resource_id,
'cloud_account_id': e['cloud_account_id']
}
return clean_expenses Parsed on ~10k ressources (little bit everything) with 20+ accounts on a entire month, I got a result accurate close of 100%. |
Secondly TVA is billed per day within Optscale. (total tva / days) |
Hi, how you define your EDP value @tguisep? How I get this information. |
It's linked to the contract of your organization with AWS. |
I would have to add that function developed inside this file like optscale/diworker/diworker/importers/aws.py or I need to do some other modification. @tguisep |
Yes, it will be optimal to apply discount there, because diworker aggregates costs from raw expenses and puts them into |
@jakelima18 I didn't make fix on the current Optscale code, I made my own external expense parser based on Opscale code/API (kind of BI module). I'm waiting for a official proper implementation, because as notified by @maxb-hystax , implementing this fix on the code is optimal but on my side I do not have enough knowledge on the global code to do it properly and understand all the potentials impact linked to this change. But, even if the values reported by Opscale are not perfectly sames than the AWS billing, it's accurate enough to give good idea on the spends. |
Hi @HugoDCileiro, you can update your cluster to commit: 6320dfa , we implemented Enterprise Discount (EDP) usage |
I compared the costs of services obtained from AWS Cost Explorer and Cost Explorer from OptsCale. And the value obtained by Cost Explorer from OptsCale was $1200 higher compared to the value obtained from AWS Cost Explorer. I tried to see what could have happened (values in different services, a bug, error in counting, etc) but I didn't find any answer.
Attached is an Excel file showing the daily comparison of the values obtained and the total for each platform. The biggest difference is in the comparison of the RDS service, which is higher in the OptsCal Cost Explorer analysis of more than $800 compared to the AWS Cost Explorer.
analyze cost optscale aws cost explorer.xlsx
The text was updated successfully, but these errors were encountered: