Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/observe-and-act/monitor-infrastructure/monitor-cloud-provider/gcp/logs.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/observe-and-act/monitor-infrastructure/monitor-cloud-provider/gcp/logs/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Google Cloud logs
Collect logs from Google Cloud with a Cloud Logging sink, Pub/Sub, and Grafana Alloy. Configure a log sink to select the Cloud Logging entries you want to export and send them to a Pub/Sub topic. A subscription makes those messages available to Alloy. Alloy uses a Google Cloud service account with permission to read the subscription, then forwards the logs to Grafana Cloud. The log sink filter controls which entries enter the pipeline. You can adjust the filter to collect the log types that matter to your monitoring needs.

Before you configure
The account that creates the sink, topic, and subscription needs the roles/logging.configWriter and roles/pubsub.editor IAM roles. The service account Alloy uses needs the roles/pubsub.subscriber role on the subscription. For the full prerequisites and setup steps, refer to Configure GCP logs.
View GCP logs
After you configure log collection, open the Logs tab in Cloud Provider Observability to view your GCP logs.
Next steps
- Configure GCP logs to create the Pub/Sub resources and set up Alloy
- Configure GCP metrics to collect metrics from Google Cloud Monitoring
Was this page helpful?
Related resources from Grafana Labs


