> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bronto.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Google Cloud Run logs to Bronto

> Forward Google Cloud Run application logs and request logs to Bronto by running an OpenTelemetry Collector bridge or by streaming Cloud Logging through Pub/Sub.

## Overview

Cloud Run writes logs to Google Cloud Logging. To reach Bronto, a Cloud Logging sink routes them to Pub/Sub, and an OpenTelemetry Collector with the `googlecloudpubsub` receiver forwards them on.

<Note>
  Do not push Pub/Sub directly to Bronto's HTTP endpoint — Pub/Sub wraps each message in an envelope (base64 `message.data`) that Bronto cannot parse. The OTel Collector unwraps it.
</Note>

## Prerequisites

* A Bronto account and API key ([how to create one](/Account-Management/API-Keys))
* A Google Cloud project with Cloud Run services and Cloud Logging enabled (the default)
* An [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/installation/) running in your GCP environment (e.g. on Cloud Run or GKE)

## How it works

```text theme={"dark"}
Cloud Run → Cloud Logging → Log sink → Pub/Sub → OTel Collector → Bronto
```

## Step 1: Route Cloud Run logs to Pub/Sub

1. Create a Pub/Sub topic (e.g. `bronto-cloud-run-logs`) and a pull subscription (e.g. `bronto-cloud-run-logs-sub`).
2. In **Logging → Log Router**, create a sink to that topic with the inclusion filter:

```text theme={"dark"}
resource.type="cloud_run_revision"
```

Grant the Collector's service account the `roles/pubsub.subscriber` role. For details, see the [Cloud Logging routing docs](https://cloud.google.com/logging/docs/export/configure_export_v2).

## Step 2: Configure the Collector

```yaml /etc/otel/config.yaml theme={"dark"}
receivers:
  googlecloudpubsub:
    project: <YOUR_GCP_PROJECT_ID>
    subscription: projects/<YOUR_GCP_PROJECT_ID>/subscriptions/bronto-cloud-run-logs-sub

processors:
  batch:

exporters:
  otlphttp/brontologs:
    logs_endpoint: "https://ingestion.<REGION>.bronto.io/v1/logs"
    compression: gzip
    headers:
      x-bronto-api-key: <YOUR_API_KEY>
      x-bronto-collection: <YOUR_COLLECTION_NAME>

service:
  pipelines:
    logs:
      receivers: [googlecloudpubsub]
      processors: [batch]
      exporters: [otlphttp/brontologs]
```

Set `<REGION>` to `eu` or `us`. Already have a Pub/Sub sink? Add just the receiver, exporter, and logs pipeline above to your existing Collector.

## What you will see in Bronto

Open [Search](https://app.bronto.io/search) and filter by your collection. You get Cloud Run **request logs** (one per HTTP request — status, latency, path) and **application logs** (anything written to stdout/stderr), with GCP metadata (project, service, revision, region) as attributes.

## Troubleshooting

* **No logs?** Confirm the Log Router sink is active and its filter matches your services; check the Pub/Sub topic's published-message count.
* **Collector not receiving?** Verify the subscription exists and the service account has `pubsub.subscriber`, then check the Collector's own logs.
* For the receiver reference, see the [`googlecloudpubsub` receiver docs](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/googlecloudpubsubreceiver).
