# Google Cloud Storage Rehydration

### Supported Types

| Metrics | Logs | Traces |
| ------- | ---- | ------ |
| ✓       | ✓    | ✓      |

### How It Works

1. This source rehydrates data previously stored by the [Google Cloud Storage Destination](https://docs.bindplane.com/integrations/destinations/google-cloud-storage).
2. It will process both uncompressed JSON objects and objects compressed with gzip.
3. You can authenticate to Google Cloud using the provided `credentials`, `credentials_file`, or by using Application Default Credentials.
4. Your authentication credentials must have the Storage Admin permission to read and delete objects.

### Notes

This is not a traditional source that continually produces data. Instead, it rehydrates all objects found within a specified time range. Once all objects in that time range have been rehydrated, the source will stop producing data.

### Configuration

<table><thead><tr><th width="153.14453125">Parameter</th><th>Type</th><th width="112.45703125">Default</th><th width="282.98046875">Description</th></tr></thead><tbody><tr><td>telemetry_types*</td><td><code>telemetrySelector</code></td><td>Logs, Metrics, Traces</td><td>Specifies which types of telemetry to rehydrate.</td></tr><tr><td>bucket_name*</td><td><code>string</code></td><td>""</td><td>The name of the bucket to rehydrate from.</td></tr><tr><td>project_id</td><td><code>string</code></td><td>""</td><td>The ID of the Google Cloud project the bucket belongs to. Will be read from credentials if not configured.</td></tr><tr><td>auth_type</td><td><code>enum</code></td><td>auto</td><td>The method used for authenticating to Google Cloud. Valid values are "auto", "json", or "file".</td></tr><tr><td>credentials</td><td><code>string</code></td><td>""</td><td>JSON value from a Google Service Account credential file. Required if auth_type is "json".</td></tr><tr><td>credentials_file</td><td><code>string</code></td><td>""</td><td>Path to a Google Service Account credential file. Required if auth_type is "file".</td></tr><tr><td>starting_time*</td><td><code>dateTime</code></td><td>""</td><td>The UTC start time for rehydration. Must be in the format "YYYY-MM-DDTHH:MM".</td></tr><tr><td>ending_time*</td><td><code>dateTime</code></td><td>""</td><td>The UTC end time for rehydration. Must be in the format "YYYY-MM-DDTHH:MM".</td></tr><tr><td>folder_name</td><td><code>string</code></td><td>""</td><td>Restricts rehydration to objects in a specific folder within the bucket.</td></tr><tr><td>batch_size</td><td><code>int</code></td><td>30</td><td>The number of objects to download at once. This impacts performance by controlling the number of concurrent object downloads.</td></tr><tr><td>delete_on_read</td><td><code>bool</code></td><td>false</td><td>If true, objects will be deleted after being rehydrated.</td></tr><tr><td>storage_enable</td><td><code>bool</code></td><td>true</td><td>Enable to specify a storage extension for rehydration progress.</td></tr><tr><td>storage_directory</td><td><code>string</code></td><td>$OIQ_OTEL_COLLECTOR_HOME/storage</td><td>Directory for storing rehydration state. Useful for maintaining state and resuming operations after disruptions.</td></tr></tbody></table>

<mark style="color:red;">\*</mark>*<mark style="color:red;">required field</mark>*

### Example Configurations

#### Basic Configuration

This configuration authenticates using Application Default Credentials and rehydrates data in the specified bucket, folder, and time range.

**Web Interface**

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-a8281ee49c3f1772fb9a036ac17925c8b976fbc8%2Fintegrations-sources-google-cloud-storage-rehydration-image-1.png?alt=media" alt="Bindplane docs - Google Cloud Storage Rehydration - image 1"><figcaption></figcaption></figure>

**Standalone Source**

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  id: google_cloud_storage_rehydration
  name: google_cloud_storage_rehydration
spec:
  type: google_cloud_storage_rehydration
  parameters:
    - name: telemetry_types
      value: ['Logs', 'Metrics', 'Traces']
    - name: bucket_name
      value: 'my-bucket'
    - name: auth_type
      value: 'auto'
    - name: starting_time
      value: '2025-03-03T16:00'
    - name: ending_time
      value: '2025-03-03T17:00'
    - name: folder_name
      value: 'my-folder-name'
    - name: batch_size
      value: 30
    - name: storage_enable
      value: false
```

#### Complete Configuration

This configuration demonstrates all available options for the Google Cloud Storage Rehydration source, including authentication, storage settings, and delete on read functionality.

**Standalone Source**

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  id: google_cloud_storage_rehydration
  name: google_cloud_storage_rehydration
spec:
  type: google_cloud_storage_rehydration
  parameters:
    - name: telemetry_types
      value: ['Logs', 'Metrics', 'Traces']
    - name: bucket_name
      value: 'my-bucket'
    - name: project_id
      value: 'my-project'
    - name: auth_type
      value: 'file'
    - name: credentials_file
      value: '/path/to/googlecloud/credentials/file'
    - name: starting_time
      value: '2025-03-03T16:00'
    - name: ending_time
      value: '2025-03-03T17:00'
    - name: folder_name
      value: 'my-folder'
    - name: batch_size
      value: 30
    - name: delete_on_read
      value: true
    - name: storage_enable
      value: true
    - name: storage_directory
      value: '/custom/storage/path'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/integrations/sources/google-cloud-storage-rehydration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
