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

# Google Cloud Storage Destination

> Export logs to Google Cloud Storage from Sawmills in OTLP JSON format. Configure bucket name, project ID, authentication method, and compression.

The Google Cloud Storage exporter marshals telemetry data into OTLP JSON format and writes it to the specified GCS bucket.

## Supported Data Types

📘 **Logs**

## Configuration

| Field                 | Type   | Default | Required | Description                                                |
| :-------------------- | :----- | :------ | :------- | :--------------------------------------------------------- |
| Name                  | String | none    | true     | Unique identifier within Sawmills.                         |
| Bucket Name           | String | none    | true     | The name of the Google Cloud Storage bucket.               |
| Project ID            | String | none    | false    | The ID of the Google Cloud project that owns the bucket.   |
| Authentication Method | Auth   | Auto    | false    | The authentication method to use for accessing the bucket. |

### Advanced Options

| Field         | Type        | Default | Required | Description                                                     |
| :------------ | :---------- | :------ | :------- | :-------------------------------------------------------------- |
| Granularity   | Hour/Minute | Minute  | false    | The time partitioning granularity for objects in the bucket.    |
| Compression   | None/Gzip   | None    | false    | Compression method for data before sending to GCS (e.g., gzip). |
| Folder Name   | String      | None    | false    | The folder name to store objects under in the bucket.           |
| Object Prefix | String      | None    | false    | The prefix to add to object names in the bucket.                |

## Authentication

The exporter supports three types of authentication:

* **Auto**: Use the automatic authentication that GCP provides (via environment variables or metadata server). Read about [application default credentials](https://cloud.google.com/docs/authentication/application-default-credentials) for more information.
* **JSON**: Use credentials JSON provided by GCP. Paste the service account key directly into the configuration.
* **File**: Specify the path to the credentials JSON file on the filesystem.

### Mounting Credentials File

To mount the credentials JSON file, configure the collector using [Helm](https://github.com/Sawmills/helm-charts). Configure this via the remote operator values YAML using the following values:

```yaml theme={null}
managedChartsValues:
  sawmills-collector:
    extraEnv:
      - name: GOOGLE_APPLICATION_CREDENTIALS
        value: /creds/credentials.json
    additionalVolumeMounts:
      - name: credentials
        mountPath: /creds
        readOnly: true
    additionalVolumes:
      - name: credentials
        secret:
          secretName: credentials
          items:
            - key: credentials.json
              path: credentials.json
```
