prometheus-bigquery-exporter
prometheus-bigquery-exporter copied to clipboard
Anyone using this to track spending?
https://cloud.google.com/billing/docs/how-to/export-data-bigquery
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.
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.