We're using connected sheets to trigger request on BigQuery.
We're trying to identify the cost of this usage on the billing account but there is only a BQ analysis service. Nothing identified in SKU as "connected sheets" for example.
Is there anyone who found a way to easily identify usage of connected sheets request on GCP ?
Thanks in advance
There is an option to see queries run by a service account or a user. You can filter from Cloud Logging by email, and identify the totalBytesBilled and totalBytesProcessed to calculate the cost. In this case, Connected Sheets will be using either a service account or a user to run the queries, you can filter based on that.
Related
I want to get a list of Active AWS Services which I am using in my AWS Account.
Thanks In Advance
The simple method I use is just to go into the Billing service and then into the Bills. You select the actual month and You should see all the charges for the services You use. 0$ means that Yo've used the service in the past.
Example:
is it in Google Cloud Platform possible to create a user with read only Access to a BigQuery Table and moreover a pre-set Budget ? I have a new colleague and he never worked before with BigQuery and i want to avoid a high bill at the end of month.
Thx
You can set, not for a specific user, but for all the users, a quotas that limit the too high cost expenses. You have details here
If you want to enforce this quotas to only this user, create a project dedicated to this user, grant them as bigquery job user (to allow them to create query jobs), and bigquery data viewer on the table/dataset that you want (to allow them to access to the data to request). on this specific project set the quotas that you want. Like that, only the user that use this project to query BigQuery will be limited by the quota.
I run a small research group at a large university that manages hundreds of GCP accounts. The university acts as the Billing Administrator, and my research group was assigned a GCP "project" for all of our work. However, for privacy reasons, they cannot give me access to the Billing API because this would allow me to see the billing details for other labs.
Because we have trainees in our lab who WILL make mistakes, I would like to setup an automated system that monitors our current GCP bill, and (1) sends notifications or (2) terminates all VMs, when that bill reaches certain predefined limits. For example, if our monthly budget is $10k, then I would like to receive a notification at $5k, another notification at $10k, and I would like to terminate all VMs at $15k.
My problem is that in order to implement a system like this, I need access to the Billing API. I have already contacted my system administrator and they have said that this is impossible. Instead, they proposed that I write a script that lists all VMs and uses the Cost Calculator to estimate my monthly GCP bill.
However, this seems a little circuitous. When I am using the Google Cloud Console, I can see the total and forecasted costs for my project, so it seems that I should be able to access this information programmatically. However, I cannot find any information on how to do this, since all solutions require me to activate the Billing API. Any ideas?
There is no API to fetch the data you see in the Google Cloud Console. You will need to export the billing data and then process each row of data to generate reports.
There are two options that I can think of:
Option 1) Ask the admin to set up billing data export to BigQuery. Grant you permission to query the billing tables. You can then query BiGQuery to generate your own cost reports.
Set up Cloud Billing data export to BigQuery
Option 2) Create a separate billing account for your project and grant you permission. A GCP ORG can have multiple Billing Accounts tied to the same Payments Account. This option supports creating budget alerts.
I have a BigQuery table that references a Google Sheet document that my service account can't access. Currently getting
"Error: Not found: Files /gdrive/id/xxxx"
I'm using the NodeJs 3.0.0 client library to access the BigQuery API.
The service user account has Data Editor, Job User and User rights on BigQuery and I have explicitly shared the google sheet to the service account.
For clarity, the user account has no issues querying other tables that it has access to, just a bunch of these external tables.
Any thoughts on what else I might need to do?
After going back through this from the start it turns out the issue was due to Google Doc editor being disabled at an organisation level. This affects both normal users and service accounts. Also ensuring that Domain-wide delegation was in place heped resolved this.
How can I use the Google Cloud Billing APIs to retrieve my total expected bill / accumulated bill so far?
Is there an API call that simply returns the cost so far for a certain billing account?
Or alternatively, a combination of calls - one for retrieving the usage data and the other with the prices for the various Google Cloud services - to calculate the costs myself?
Thank you
Have you try Google Cloud Billing Report ?
https://cloudplatform.googleblog.com/2018/03/understand-your-spending-at-a-glance-with-Google-Cloud-Billing-reports-beta.html
Yes, there is an API to accomplish what you want.
You can control costs, track expenses and create alerts to notify billing administrators following this guide
Based on the comment below Alexandre answer, You can get programmatic budget notifications using Google Cloud Billing API setting up budget notifications as described in this tutorial.
I suggest you to start trying the quickstart, which performs simpler API calls.