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

Anyone using this to track spending? #24

Open
kaihendry opened this issue Dec 8, 2019 · 2 comments
Open

Anyone using this to track spending? #24

kaihendry opened this issue Dec 8, 2019 · 2 comments

Comments

@kaihendry
Copy link

https://cloud.google.com/billing/docs/how-to/export-data-bigquery

@stephen-soltesz
Copy link
Contributor

Hi, @kaihendry good question -- I didn't know that billing export was a thing -- but if the data is in BQ then the bigquery_exporter should be able to report metrics about it. That's a really interesting idea.

@kaihendry
Copy link
Author

A typical query is cost per product in a project:
https://github.com/future-architect/gbilling2slack/blob/master/invoice/invoice.go#L39-L54

I am not quite sure how I expect the metrics to be exported. Lots of:
cost{project="myteam",service="Compute Engine"} 999.7192939999995
???

Which get reset when partitiontime = '2019-12-09' becomes the new UTC day I guess

These queries for example on my data set can take 279 MB bytes billed and can take ~15s. So the scrape would have to be every minute, max! And tbh I have no idea how much $$$ really is "279 MB bytes billed". In fact I am wondering when the billiing data gets updated since I've been running it every minute and the totals don't appear to change.

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

No branches or pull requests

2 participants