When this page refers to a 'project', it means a Google Cloud project, as you would find in your project selector in your Google Cloud console.
Explore documentation
Getting started with Google Cloud
Better Stack offers a deeply integrated experience with Google Cloud, allowing you to seamlessly monitor your cloud infrastructure.
Deploy our prepared deployment configuration into your GCP project using our gcloud script or Terraform module to gain comprehensive observability.
This integration provides:
- Automatic scraping of chosen Google Cloud metrics.
- Automatic forwarding of logs from Google Cloud (with configurable filtering).
You can integrate either at a per-project level (by default) or connect your whole organization, to pick up current and future projects automatically.
1. Create a source
Create a new GCP Source in Better Stack. You can deploy multiple sources to ingest data from the same project/projects if you wish to split logs and/or metrics with different retention periods.
2. Deploy the Google Cloud components
You can deploy the Google Cloud integration using either a gcloud bash script, or a Terraform module. You can find documentation for both in the public repository at https://github.com/BetterStackHQ/gcp/.
To deploy the Google Cloud integration using the gcloud bash script, you will need the gcloud cli installed, and then you can either deploy the integration to a single project (with no access to others) or to your organization, with access to all projects.
When deploying with access to the whole organization, the deployment project indicates where IAM resources and the compute components for forwarding logs are deployed. You may wish to create a project especially for this purpose.
3. Configure the integration
Once the deployment has run, enter the Project ID and Project Number outputs from the script, and press 'Save' to complete the integration.
We will immediately synchronize your project details with Better Stack, and start loading your available metrics.
Log filtering
You can supply a log filter expression in your source's configuration that configures the log sink inside Google Cloud, meaning you can restrict the logs sent to Better Stack early, reducing any processing or egress costs.
The filter syntax uses the Google Cloud logging query language.
Metric selection
Better Stack loads the set of active metric types for your project(s) and allows you to choose which you would like to scrape and be queryable in Better Stack.
You can choose to scrape all metrics, all metric types for a given service (Compute, Cloud Storage etc), or individual metrics.
When we ingest metrics we convert them to Better Stack naming, so, for example compute.googleapis.com/firewall/dropped_bytes_count becomes gcp.firewall.dropped_bytes_count.
Loading the set of available metrics can take a few minutes on setting up the first project.
OpenTelemetry Traces
The recommended way to forward OpenTelemetry traces from your applications running in Google Cloud is either to export directly to a source in Better Stack or via an OpenTelemetry collector; you can see more details on this in our dedicated OpenTelemetry documentation.
Removing the GCP integration
To remove the GCP integration, if using the gcloud setup bash script, run the same command used to set up the integration, but with an additional --teardown argument.
If using Terraform, you can use terraform destroy.
Our integration deploys a Workload Identity Pool into your project; these pools are 'soft-deleted' inside Google Cloud for 30 days. If you wish to redeploy again, the setup script will handle this automatically, but you will need to import the existing pool resource into Terraform.
Need help?
Please let us know at hello@betterstack.com.
We're happy to help! 🙏