prometheus-bigquery-exporter icon indicating copy to clipboard operation
prometheus-bigquery-exporter copied to clipboard

Anyone using this to track spending?

Open kaihendry opened this issue 5 years ago • 2 comments

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

kaihendry avatar Dec 08 '19 12:12 kaihendry

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.

stephen-soltesz avatar Dec 09 '19 15:12 stephen-soltesz

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.

kaihendry avatar Dec 10 '19 03:12 kaihendry