> ## 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 telemetry to Bronto

> Send Cloud Run application logs, metrics, and traces through an OpenTelemetry Collector sidecar, and platform request logs through Cloud Logging Pub/Sub.

## Overview

For application telemetry, run an OpenTelemetry Collector sidecar in the same Cloud Run service and send logs, metrics, and traces to its configured OTLP receiver. `http://localhost:4318` is the usual OTLP/HTTP default for this sidecar topology, but the address, protocol, and TLS settings must match your Collector configuration. Cloud Run platform request logs remain in Cloud Logging; route those through Pub/Sub when you need them in Bronto too.

<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)

## Application telemetry through a sidecar

Instrument the application with the [OpenTelemetry SDK](/opentelemetry/overview) and point it at the Collector sidecar. With the receiver configuration below, use the standard local OTLP/HTTP base endpoint `http://localhost:4318`; change it if you customize the receiver.

```yaml /etc/otel/config.yaml theme={"dark"}
receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch:

exporters:
  otlphttp/bronto:
    logs_endpoint: "https://ingestion.<REGION>.bronto.io/v1/logs"
    metrics_endpoint: "https://ingestion.<REGION>.bronto.io/v1/metrics"
    traces_endpoint: "https://ingestion.<REGION>.bronto.io/v1/traces"
    compression: gzip
    headers:
      x-bronto-api-key: <YOUR_API_KEY>

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/bronto]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/bronto]
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/bronto]
```

<Note>
  Exponential histograms are not supported, and the Metric Explorer does not currently provide a Rate function.
</Note>

## Platform request logs through Pub/Sub

Cloud Run writes platform request logs to Cloud Logging. To forward them:

```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 for application and request logs, Metric Explorer for metrics, and Explore Traces for spans. Resource attributes identify the Cloud Run service, revision, project, and region.

## 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).
