Section 3 · Cloud logs

Collect GCP logs using Grafana Alloy with Pub/Sub.

Estimated time: 1 min

How it works

Complexity: Moderate | Infrastructure: Pub/Sub + Alloy | Latency: Streaming

GCP logs collection pipeline

You create a log sink in Cloud Logging with filters that select which logs to export. The sink routes them to a Pub/Sub topic. Alloy subscribes to the topic, processes the logs, and forwards them to Grafana Cloud Logs. Sink filters let you reduce volume at the source.

Considerations

  • Reliable Pub/Sub message delivery
  • Log sink filtering to reduce volume
  • Workload identity authentication
  • Full processing pipeline
  • Alloy infrastructure to deploy, maintain, and update
  • Pub/Sub cost, plus setup steps

Documentation

View the GCP logs documentation.