|
|
|
|
@ -4,49 +4,58 @@ description: Loki Configuration Examples |
|
|
|
|
--- |
|
|
|
|
# Examples |
|
|
|
|
|
|
|
|
|
## almost-zero-dependency.yaml |
|
|
|
|
## 1-Local-Configuration-Example.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# This is a configuration to deploy Loki depending only on a storage solution |
|
|
|
|
# for example, an S3-compatible API like MinIO. |
|
|
|
|
# The ring configuration is based on the gossip memberlist and the index is shipped to storage |
|
|
|
|
# via Single Store (boltdb-shipper) |
|
|
|
|
|
|
|
|
|
auth_enabled: false |
|
|
|
|
|
|
|
|
|
server: |
|
|
|
|
http_listen_port: 3100 |
|
|
|
|
|
|
|
|
|
distributor: |
|
|
|
|
common: |
|
|
|
|
ring: |
|
|
|
|
instance_addr: 127.0.0.1 |
|
|
|
|
kvstore: |
|
|
|
|
store: memberlist |
|
|
|
|
store: inmemory |
|
|
|
|
replication_factor: 1 |
|
|
|
|
path_prefix: /tmp/loki |
|
|
|
|
|
|
|
|
|
ingester: |
|
|
|
|
lifecycler: |
|
|
|
|
ring: |
|
|
|
|
kvstore: |
|
|
|
|
store: memberlist |
|
|
|
|
replication_factor: 1 |
|
|
|
|
final_sleep: 0s |
|
|
|
|
chunk_idle_period: 5m |
|
|
|
|
chunk_retain_period: 30s |
|
|
|
|
schema_config: |
|
|
|
|
configs: |
|
|
|
|
- from: 2020-05-15 |
|
|
|
|
store: boltdb-shipper |
|
|
|
|
object_store: filesystem |
|
|
|
|
schema: v11 |
|
|
|
|
index: |
|
|
|
|
prefix: index_ |
|
|
|
|
period: 24h |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
memberlist: |
|
|
|
|
abort_if_cluster_join_fails: false |
|
|
|
|
|
|
|
|
|
# Expose this port on all distributor, ingester |
|
|
|
|
# and querier replicas. |
|
|
|
|
bind_port: 7946 |
|
|
|
|
## 2-S3-Cluster-Example.yaml |
|
|
|
|
|
|
|
|
|
# You can use a headless k8s service for all distributor, |
|
|
|
|
# ingester and querier components. |
|
|
|
|
join_members: |
|
|
|
|
- loki-gossip-ring.loki.svc.cluster.local:7946 |
|
|
|
|
```yaml |
|
|
|
|
# This is a complete configuration to deploy Loki backed by a s3-Comaptible API |
|
|
|
|
# like MinIO for storage. Loki components will use memberlist ring to shard and |
|
|
|
|
# the index will be shipped to storage via boltdb-shipper. |
|
|
|
|
|
|
|
|
|
auth_enabled: false |
|
|
|
|
|
|
|
|
|
server: |
|
|
|
|
http_listen_port: 3100 |
|
|
|
|
|
|
|
|
|
common: |
|
|
|
|
ring: |
|
|
|
|
instance_addr: 127.0.0.1 |
|
|
|
|
kvstore: |
|
|
|
|
store: memberlist |
|
|
|
|
replication_factor: 1 |
|
|
|
|
path_prefix: /loki # Update this accordingly, data will be stored here. |
|
|
|
|
|
|
|
|
|
max_join_backoff: 1m |
|
|
|
|
max_join_retries: 10 |
|
|
|
|
min_join_backoff: 1s |
|
|
|
|
memberlist: |
|
|
|
|
join_members: |
|
|
|
|
# You can use a headless k8s service for all distributor, ingester and querier components. |
|
|
|
|
- loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port. |
|
|
|
|
|
|
|
|
|
schema_config: |
|
|
|
|
configs: |
|
|
|
|
@ -63,24 +72,18 @@ storage_config: |
|
|
|
|
active_index_directory: /loki/index |
|
|
|
|
cache_location: /loki/index_cache |
|
|
|
|
shared_store: s3 |
|
|
|
|
|
|
|
|
|
aws: |
|
|
|
|
s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name |
|
|
|
|
s3forcepathstyle: true |
|
|
|
|
|
|
|
|
|
limits_config: |
|
|
|
|
enforce_metric_name: false |
|
|
|
|
reject_old_samples: true |
|
|
|
|
reject_old_samples_max_age: 168h |
|
|
|
|
|
|
|
|
|
compactor: |
|
|
|
|
working_directory: /data/compactor |
|
|
|
|
working_directory: /loki/compactor |
|
|
|
|
shared_store: s3 |
|
|
|
|
compaction_interval: 5m |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## aws-basic-config-no-creds.yaml |
|
|
|
|
## 3-S3-Without-Credentials-Snippet.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# If you don't wish to hard-code S3 credentials you can also configure an EC2 |
|
|
|
|
@ -103,29 +106,7 @@ storage_config: |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## aws-basic-config.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage |
|
|
|
|
|
|
|
|
|
schema_config: |
|
|
|
|
configs: |
|
|
|
|
- from: 2020-05-15 |
|
|
|
|
store: aws |
|
|
|
|
object_store: s3 |
|
|
|
|
schema: v11 |
|
|
|
|
index: |
|
|
|
|
prefix: loki_ |
|
|
|
|
storage_config: |
|
|
|
|
aws: |
|
|
|
|
s3: s3://access_key:secret_access_key@region/bucket_name |
|
|
|
|
dynamodb: |
|
|
|
|
dynamodb_url: dynamodb://access_key:secret_access_key@region |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## bos-config.yaml |
|
|
|
|
## 4-BOS-Example.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
schema_config: |
|
|
|
|
@ -156,83 +137,60 @@ compactor: |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## cassandra-index.yaml |
|
|
|
|
## 5-S3-And-DynamoDB-Snippet.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage |
|
|
|
|
# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage |
|
|
|
|
|
|
|
|
|
schema_config: |
|
|
|
|
configs: |
|
|
|
|
- from: 2020-05-15 |
|
|
|
|
store: cassandra |
|
|
|
|
object_store: filesystem |
|
|
|
|
store: aws |
|
|
|
|
object_store: s3 |
|
|
|
|
schema: v11 |
|
|
|
|
index: |
|
|
|
|
prefix: cassandra_table |
|
|
|
|
period: 168h |
|
|
|
|
|
|
|
|
|
prefix: loki_ |
|
|
|
|
storage_config: |
|
|
|
|
cassandra: |
|
|
|
|
username: cassandra |
|
|
|
|
password: cassandra |
|
|
|
|
addresses: 127.0.0.1 |
|
|
|
|
auth: true |
|
|
|
|
keyspace: lokiindex |
|
|
|
|
|
|
|
|
|
filesystem: |
|
|
|
|
directory: /tmp/loki/chunks |
|
|
|
|
|
|
|
|
|
aws: |
|
|
|
|
s3: s3://access_key:secret_access_key@region/bucket_name |
|
|
|
|
dynamodb: |
|
|
|
|
dynamodb_url: dynamodb://access_key:secret_access_key@region |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## complete-local-config.yaml |
|
|
|
|
## 6-Cassandra-Snippet.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
auth_enabled: false |
|
|
|
|
|
|
|
|
|
server: |
|
|
|
|
http_listen_port: 3100 |
|
|
|
|
|
|
|
|
|
ingester: |
|
|
|
|
lifecycler: |
|
|
|
|
address: 127.0.0.1 |
|
|
|
|
ring: |
|
|
|
|
kvstore: |
|
|
|
|
store: inmemory |
|
|
|
|
replication_factor: 1 |
|
|
|
|
final_sleep: 0s |
|
|
|
|
chunk_idle_period: 5m |
|
|
|
|
chunk_retain_period: 30s |
|
|
|
|
# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage |
|
|
|
|
|
|
|
|
|
schema_config: |
|
|
|
|
configs: |
|
|
|
|
- from: 2020-05-15 |
|
|
|
|
store: boltdb |
|
|
|
|
store: cassandra |
|
|
|
|
object_store: filesystem |
|
|
|
|
schema: v11 |
|
|
|
|
index: |
|
|
|
|
prefix: index_ |
|
|
|
|
prefix: cassandra_table |
|
|
|
|
period: 168h |
|
|
|
|
|
|
|
|
|
storage_config: |
|
|
|
|
boltdb: |
|
|
|
|
directory: /tmp/loki/index |
|
|
|
|
cassandra: |
|
|
|
|
username: cassandra |
|
|
|
|
password: cassandra |
|
|
|
|
addresses: 127.0.0.1 |
|
|
|
|
auth: true |
|
|
|
|
keyspace: lokiindex |
|
|
|
|
|
|
|
|
|
filesystem: |
|
|
|
|
directory: /tmp/loki/chunks |
|
|
|
|
|
|
|
|
|
limits_config: |
|
|
|
|
enforce_metric_name: false |
|
|
|
|
reject_old_samples: true |
|
|
|
|
reject_old_samples_max_age: 168h |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## example-schema-config.yaml |
|
|
|
|
## 7-Schema-Migration-Snippet.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# Additional example schema configuration for Cassandra |
|
|
|
|
|
|
|
|
|
schema_config: |
|
|
|
|
configs: |
|
|
|
|
# Starting from 2018-04-15 Loki should store indexes on Cassandra |
|
|
|
|
@ -258,7 +216,7 @@ schema_config: |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## google-cloud-storage-config.yaml |
|
|
|
|
## 8-GCS-Snippet.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# This partial configuration uses GCS for chunk storage and uses BigTable for index storage |
|
|
|
|
@ -283,31 +241,7 @@ storage_config: |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## s3-compatible-apis.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# S3-compatible APIs such as Ceph Object Storage with an S3-compatible API, can be used. |
|
|
|
|
# If the API supports path-style URLs rather than virtual hosted bucket addressing, |
|
|
|
|
# configure the URL in `storage_config` with the custom endpoint |
|
|
|
|
|
|
|
|
|
schema_config: |
|
|
|
|
configs: |
|
|
|
|
- from: 2020-05-15 |
|
|
|
|
store: aws |
|
|
|
|
object_store: s3 |
|
|
|
|
schema: v11 |
|
|
|
|
index: |
|
|
|
|
prefix: loki_ |
|
|
|
|
storage_config: |
|
|
|
|
aws: |
|
|
|
|
s3: s3://access_key:secret_access_key@region/bucket_name |
|
|
|
|
dynamodb: |
|
|
|
|
dynamodb_url: dynamodb://access_key:secret_access_key@region |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## s3-expanded-config.yaml |
|
|
|
|
## 9-Expanded-S3-Snippet.yaml |
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
|
# S3 configuration supports an expanded configuration. |
|
|
|
|
|