Google Cloud Storage Destination
The Google Cloud Storage destination is available for the Archive Logs template. Use this destination to send your logs in Datadog-rehydratable format to a Google Cloud Storage bucket for archiving. You need to set up Datadog Log Archives if you haven’t already, and then set up the destination in the pipeline UI.
If you already have a Datadog Log Archive configured for Observability Pipelines, skip to Set up the destination for your pipeline.
You need to have Datadog’s Google Cloud Platform integration installed to set up Datadog Log Archives.
Create a storage bucket
- Navigate to Google Cloud Storage.
- On the Buckets page, click Create to create a bucket for your archives..
- Enter a name for the bucket and choose where to store your data.
- Select Fine-grained in the Choose how to control access to objects section.
- Do not add a retention policy because the most recent data needs to be rewritten in some rare cases (typically a timeout case).
- Click Create.
Create a service account to allow Workers to write to the bucket
- Create a Google Cloud Storage service account.
- Grant the Service Account permissions to your bucket with
Storage Admin
and Storage Object Admin
permissions. - Download the JSON service account key file. This is the credentials JSON file and must be placed under
DD_OP_DATA_DIR/config
. You reference this file when you set up the Google Cloud Storage destination in the pipeline UI later on.
- Follow these instructions to create a service account key. Choose
json
for the key type.
Connect the storage bucket to Datadog Log Archives
- Navigate to Datadog Log Forwarding.
- Click New archive.
- Enter a descriptive archive name.
- Add a query that filters out all logs going through log pipelines so that none of those logs go into this archive. For example, add the query
observability_pipelines_read_only_archive
, assuming no logs going through the pipeline have that tag added. - Select Google Cloud Storage.
- Select the service account your storage bucket is in.
- Select the project.
- Enter the name of the storage bucket you created earlier.
- Optionally, enter a path.
- Optionally, set permissions, add tags, and define the maximum scan size for rehydration. See Advanced settings for more information.
- Click Save.
See the Log Archives documentation for additional information.
Set up the destination for your pipeline
Set up the Amazon S3 destination and its environment variables when you set up an Archive Logs pipeline. The information below is configured in the pipelines UI.
- Enter the name of the Google Cloud storage bucket you created earlier.
- Enter the path to the credentials JSON file you downloaded earlier.
- Select the storage class for the created objects.
- Select the access level of the created objects.
- Optionally, enter in the prefix.
- Prefixes are useful for partitioning objects. For example, you can use a prefix as an object key to store objects under a particular directory. If using a prefix for this purpose, it must end in
/
to act as a directory path; a trailing /
is not automatically added. - See template syntax if you want to route logs to different object keys based on specific fields in your logs.
- Optionally, click Add Header to add metadata.
Set the environment variables
There are no environment variables to configure.
How the destination works
Event batching
A batch of events is flushed when one of these parameters is met. See event batching for more information.
Max Events | Max Bytes | Timeout (seconds) |
---|
None | 100,000,000 | 900 |