# Google Run logging

## Start logging in 10 minutes

Ship your Google Run runtime logs to Better Stack using a Vector sidecar container.

## Create Better Stack Vector source

1.  Go to [Better Stack → Sources](https://telemetry.betterstack.com/team/0/sources) → **Connect source**.
2.  Name your source and select **Vector** from the **Logs + Metrics** section.
3.  Keep this tab open. You’ll need the **Source token** and **Ingesting host** later.

## Create Google Run volume

1.  Navigate to **Google Cloud** → **Google Run**.
2.  Open configuration for your Service or Job.
3.  Create volume of any type.

![google_run_volumes.png](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/9a170002-10dc-444a-f8e6-26c919f0a400/lg1x =1280x898)

[info]

All logs will be written to this volume. The Better Stack sidecar container will read the logs from the volume and ship them our way.
[/info]

## Mount the volume and add the Better Stack sidecar container

Attach the volume to both your main container and the Better Stack sidecar container, and configure the sidecar.

1.  **Mount volume to main container**
    * Navigate to **Containers** tab -> **Volume mounts** tab.
    * Click **Mount volume** and choose the volume you created.
    * Type in **Mount path** – e.g., `shared-volume/logs`.
2.  **Add Better Stack sidecar container**
    * Scroll down and select **Add container**
    * Fill in **Container image URL**: `registry-1.docker.io/betterstack/google-run-vector:amd64-latest`
3.  **Configure startup probe**
    * Stay in **Settings** tab.
    * Set **Startup probe** → **Port: 8686**.
4.  **Add environment variables**

    In **Variables & secrets**, add the following variables:

    ```bash
    [label Environment variables]
    BETTER_STACK_SOURCE_TOKEN=$SOURCE_TOKEN
    BETTER_STACK_INGESTING_HOST=$INGESTING_HOST
    BETTER_STACK_LOG_PATH=shared-volume/logs/*.log
    ```

5.  **Mount volume to sidecar container**
    * Click **Volume mounts** tab -> **Mount volume**.
    * Select the volume you created.
    * Fill in **Mount path** – e.g., `shared-volume/logs`.

![google_run_mount_container.png](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/5a72ea6e-27ff-4533-eaa3-a09fc512f600/orig =1300x816)

## Write logs to the shared volume

Make sure your main container writes logs to the mounted volume – e.g., `shared-volume/logs/app.log`.

You should see your logs in [Better Stack → Live tail](https://telemetry.betterstack.com/team/0/tail ";_blank").

## Need help?

Please let us know at hello@betterstack.com.  
We're happy to help! 🙏