Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwanthgoli committed Feb 7, 2025
1 parent 8b16e4d commit f34fad1
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/sources/configure/examples/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ weight: 800
The following pages contain examples of how to configure Grafana Loki.

- [Configuration snippets and ready-to-use configuration examples]({{< relref "./configuration-examples" >}}).
- [Deploy a query frontend on a existing cluster]({{< relref "./query-frontend" >}}).
- [Deploy a query frontend on a existing cluster]({{< relref "./query-frontend" >}}).
- [Configuration examples for using Thanos-based storage clients](./thanos-storage-configs).
66 changes: 66 additions & 0 deletions docs/sources/configure/examples/thanos-storage-configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "Configuration examples for using Thanos-based storage clients"
description: "Minimal examples for using Thanos-based S3, GCS, Azure, and filesystem clients in Grafana Loki."
weight: 100
---

# Configuration examples for using Thanos-based storage clients

Use these examples as a starting point for configuring [Thanos based object storage clients](https://grafana.com/docs/loki/<LOKI_VERSION>/configure/#thanos_object_store_config) in Grafana Loki.

## GCS example
```yaml
storage_config:
use_thanos_objstore: true
object_store:
gcs:
bucket_name: my-gcs-bucket

# JSON either from a Google Developers Console client_credentials.json file,
# or a Google Developers service account key. Needs to be valid JSON, not a
# filesystem path. If empty, fallback to Google default logic:
# 1. A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS
# environment variable. For workload identity federation, refer to
# https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation
# on how to generate the JSON configuration file for on-prem/non-Google cloud
# platforms.
# 2. A JSON file in a location known to the gcloud command-line tool:
# $HOME/.config/gcloud/application_default_credentials.json.
# 3. On Google Compute Engine it fetches credentials from the metadata server.
service_account: service-account-json
```
## S3 example
```yaml
storage_config:
use_thanos_objstore: true
object_store:
s3:
bucket_name: my-s3-bucket
endpoint: s3.us-west-2.amazonaws.com
region: us-west-2
# You can either declare the access key and secret in the config or
# use environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY which will be picked up by AWS SDK.
access_key_id: access-key-id
secret_access_key: secret-access-key
```
## Azure example
```yaml
storage_config:
use_thanos_objstore: true
object_store:
azure:
account_name: myaccount
account_key: ${SECRET_ACCESS_KEY} # loki expands environment variables
container_name: example-container
```
## Filesystem example
```yaml
storage_config:
use_thanos_objstore: true
object_store:
filesystem:
dir: /var/loki/chunks
```

0 comments on commit f34fad1

Please sign in to comment.