Loki Configuration Examples

  1. Complete Local Config
  2. Google Cloud Storage
  3. Cassandra Index
  4. AWS

Complete Local config

  1. auth_enabled: false
  2. server:
  3. http_listen_port: 3100
  4. ingester:
  5. lifecycler:
  6. address: 127.0.0.1
  7. ring:
  8. kvstore:
  9. store: inmemory
  10. replication_factor: 1
  11. final_sleep: 0s
  12. chunk_idle_period: 5m
  13. chunk_retain_period: 30s
  14. schema_config:
  15. configs:
  16. - from: 2018-04-15
  17. store: boltdb
  18. object_store: filesystem
  19. schema: v9
  20. index:
  21. prefix: index_
  22. period: 168h
  23. storage_config:
  24. boltdb:
  25. directory: /tmp/loki/index
  26. filesystem:
  27. directory: /tmp/loki/chunks
  28. limits_config:
  29. enforce_metric_name: false
  30. reject_old_samples: true
  31. reject_old_samples_max_age: 168h
  32. chunk_store_config:
  33. max_look_back_period: 0
  34. table_manager:
  35. chunk_tables_provisioning:
  36. inactive_read_throughput: 0
  37. inactive_write_throughput: 0
  38. provisioned_read_throughput: 0
  39. provisioned_write_throughput: 0
  40. index_tables_provisioning:
  41. inactive_read_throughput: 0
  42. inactive_write_throughput: 0
  43. provisioned_read_throughput: 0
  44. provisioned_write_throughput: 0
  45. retention_deletes_enabled: false
  46. retention_period: 0

Google Cloud Storage

This is partial config that uses GCS and Bigtable for the chunk and indexstores, respectively.

  1. schema_config:
  2. configs:
  3. - from: 2018-04-15
  4. store: bigtable
  5. object_store: gcs
  6. schema: v9
  7. index:
  8. prefix: loki_index_
  9. period: 168h
  10. storage_config:
  11. bigtable:
  12. instance: BIGTABLE_INSTANCE
  13. project: BIGTABLE_PROJECT
  14. gcs:
  15. bucket_name: GCS_BUCKET_NAME

Cassandra Index

This is a partial config that uses the local filesystem for chunk storage andCassandra for the index storage:

  1. schema_config:
  2. configs:
  3. - from: 2018-04-15
  4. store: cassandra
  5. object_store: filesystem
  6. schema: v9
  7. index:
  8. prefix: cassandra_table
  9. period: 168h
  10. storage_config:
  11. cassandra:
  12. username: cassandra
  13. password: cassandra
  14. addresses: 127.0.0.1
  15. auth: true
  16. keyspace: lokiindex
  17. filesystem:
  18. directory: /tmp/loki/chunks

AWS

This is a partial config that uses S3 for chunk storage and DynamoDB for theindex storage:

  1. schema_config:
  2. configs:
  3. - from: 2018-04-15
  4. store: dynamo
  5. object_store: s3
  6. schema: v9
  7. index:
  8. prefix: dynamodb_table_name
  9. period: 0
  10. storage_config:
  11. aws:
  12. s3: s3://access_key:secret_access_key@region/bucket_name
  13. dynamodbconfig:
  14. dynamodb: dynamodb://access_key:secret_access_key@region

If you don’t wish to hard-code S3 credentials, you can also configure an EC2instance role by changing the storage_config section:

  1. storage_config:
  2. aws:
  3. s3: s3://region/bucket_name
  4. dynamodbconfig:
  5. dynamodb: dynamodb://region

S3-compatible APIs

S3-compatible APIs (e.g., Ceph Object Storage with an S3-compatible API) can beused. If the API supports path-style URL rather than virtual hosted bucketaddressing, configure the URL in storage_config with the custom endpoint:

  1. storage_config:
  2. aws:
  3. s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name
  4. s3forcepathstyle: true