electrolux-oss / infrawallet

Control your cloud costs just in the way how you control your bank accounts
https://demo.infrawallet.io
Apache License 2.0
34 stars 2 forks source link

Add savings to cost Provider #41

Closed jonathan-arenas-edo closed 1 month ago

jonathan-arenas-edo commented 1 month ago

Hi, I'm working on GCP and I can view the cost of my services, So far everything is perfect. But the plugin show me the cost of services without saving, is it possible to add the commitments?

Documentation: https://cloud.google.com/billing/docs/how-to/bq-examples

Example: `SELECT invoice.month, SUM(cost)

Thank you.

gluckzhang commented 1 month ago

Hi @jonathan-arenas-edo, thanks for the suggestion. It is quite a nice idea. I think this is also a generic case for different cloud providers. There are different kinds of costs (e.g., unblended cost, amortized cost, etc.). Ideally, users should be to configure what kind of cost InfraWallet needs to query (in the config yaml file at least for now, because later on we can provide UI for configurations).

I will discuss more with the team and see how we can support it :)

jonathan-arenas-edo commented 1 month ago

Great @gluckzhang thank you for your time and effort on it.

gluckzhang commented 1 month ago

Hi @jonathan-arenas-edo, based on the example, I have updated the query to (SUM(CAST(cost AS NUMERIC)) + SUM(IFNULL((SELECT SUM(CAST(c.amount AS NUMERIC)) FROM UNNEST(credits) AS c), 0))) AS total_cost for GCP client. This is available in https://github.com/electrolux-oss/infrawallet/releases/tag/v0.1.7. Welcome to verify it :)

jonathan-arenas-edo commented 1 month ago

Great! I will check asap and I will give you my feedback. @gluckzhang

jonathan-arenas-edo commented 1 month ago

Hi @gluckzhang, I confirm that it is working well, I can see the costs with savings.

Thank you. Best regards.

gluckzhang commented 1 month ago

That's great. Then I am going to close this ticket :)