GCP Cost per project

I’m trying to use dotnet library to get GCP information and specifically the total cost for a project.
I found only billing api and I’m wondering if there is any workaround to get this data ?


How to use GCP monitoring CPU Usage alert to spin a new VM instance (implementing custom autoscaling)

I have 2 GCP VMs connected to a load balancer (it is an ummanaged instance group).

  1. I would like to spin a new VM whenever I receieve a CPU Usage alert (usage higher then 70%). This is a customized scenario and I cannot use GCP built in autoscaling.

Are the following 2 scenarios possible ? looking for some direction here.

  1. My custom code will spin a new VM and deploy custom code on instance.
  2. Can I attach the new VM to the LB after step 1 above.


load balancing – Service interruption caused by Readiness Probe Failure from GCP

enter image description here

It only happened recently from November 7th.

Readiness probe failed: Get http://xxxx.xxx/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

I don’t need to do anything after a few hours everything back to normal. Was it caused by the GCP failure somehow?

The end users will get 502 error or timeout.


google cloud platform – GCP BigQuery fedarated query to cloudsql gives connection not found error

I need to populate a BigQuery table by executing a cloud sql “federated query” ( see https://cloud.google.com/bigquery/docs/cloud-sql-federated-queries#overview to read about federated queries)
In simpler words I create a “connection” to cloudsql MySql database and run an “External” mysql query from BIGQuery console to insert data into a BIGQuery table.

I do have a valid “connection” (called myconnectionid) set-up from my BigQuery console.
If I run query as follows BigQuery console, it runs fine and gives me rows from my cloudsql mysql table

SELECT * FROM EXTERNAL_QUERY("myproject.us.myconnectionid", "SELECT * from my-cloudsql-table;")

However if I run the same query as part of an insert into as follows

insert into my-bq-dataset.my-bq-table SELECT * FROM EXTERNAL_QUERY("myproject.us.myconnectionid", "SELECT * from my-cloudsql-table;")

Then I get an error “Not found: Connection myconnectionid

Since the a plain select using same External connection with id “myconnectionid” works fine ; I wonder if I am making a mistake in writing my “insert into” sql , or is it something else thats needed for a connection so it may be used as part of insert into statement.

Please do share your thoughts

Huge thanks for your help

And wishing you a happy and safe holiday season

Architecture – For cloud services like GCP Cloud Run, should a restful API also subscribe to a message queue and how

In a bit of a quandary. I am using Cloud Run on GCP for backend services, and it will auto-scale based on HTTP load, potentially scaling down to 0 if there is no traffic for awhile.

I have a product with 3 backend restful services running on Cloud Run, and the backend services need to communicate with each other. They could post messages directly to each other, as one option. But let’s assume we want a message queue to ensure delivery of messages.

My question is – if I have a RabbitMQ subscription in each of the services – will Cloud Run know to keep the service alive? Will it know to scale up if more messages are received from Rabbit? Is it a design smell to have a restful service that also subscribes to a message queue via a TCP connection? My main concern is how Cloud Run itself keeps services alive and how it auto-scales based on the TCP message load. My guess is that Cloud Run mostly deals with HTTP messages and doesn’t know how to deal with TCP connections?

One potential answer to the question is to use GCP’s pub/sub instead of RabbitMQ, but I am curious if it could be solved using RabbitMQ. The problem with GCP pub/sub is that I don’t want to fan out, I just want the message to be processed by one instance of a service, not all instances.

Also: Can someone create a tag “gcp” and add it the question please.

Is it possible for users to request vPMU/arch_perfmon feature on GCP instances for profiling purpose?

As the title says. I asked the PCM community here (https://github.com/opcm/pcm/discussions/257) and they thought this might be the only solution to get PCM running on GCP. Anyone can help?

Thanks a lot!

GCP Static Site Redirect domain.com and www.domains.com to domains.com

I the following configured so far

  • backend buckets for domain.com and domains.com
  • https load balancer with certificated pointing to the domains.com bucket
  • http load balancer redirecting traffic to the https load balancer
  • A records set for domains.com and www.domains.com pointing to the https load balancer ip

I now need to get domain.com and www.domain.com to redirect over to domains.com

I would also like to have www.domains.com be re-written to just domains.com

How to get Kubernetes Services IP address using GCP APIs

I need to get the Kubernetes Service IP address (internal and external) using the Google Cloud Provider APIs.
How do I get the Kubernetes Services IP address using GCP APIs?


google cloud platform – change storage class a folder gcp

Stack Exchange Network

Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

google cloud platform – GCP SLQ instance wont stop ,restart, or delete

The status says “under maintenance” and has for several hours. This is a not a large database as I am a new student with very small tables for learning. I have tried stopping and restarting as well as deleting the instance, but get an error message every time. The error simply says “The attempted action failed, please try again. Request ID: 4022803414404737811”. Operations and logs shows an “update” error “unknown error” this morning, but no other information given.

I have logged out of GCP and back in with no effect.