Loki

v3.5.x

install using APT

  1. Add the Grafana Advanced Package Tool (APT) or RPM Package Manager (RPM) package repository following the linked instructions.
  2. Install Loki
apt-get update
apt-cache madison loki
apt-get install loki=3.5.8


S3 Single Store

config.yaml

auth_enabled: true  # true,  multi-tenant mode

server:
  http_listen_port: 3100
  grpc_listen_port: 9096
  log_level: info
  grpc_server_max_concurrent_streams: 1000

common:
  #instance_addr: 127.0.0.1
  path_prefix: /loki  # `mkdir /loki && chown loki /loki`. Create the `/loki` directory locally to store the index and cache.
  replication_factor: 1
  ring:
    kvstore:
      store: inmemory

query_range:
  results_cache:
    cache:
      embedded_cache:
        enabled: true
        max_size_mb: 100

limits_config:
  metric_aggregation_enabled: true

schema_config:
  configs:
    - from: 2020-10-24
      store: tsdb
      object_store: s3  # s3
      schema: v13
      index:
        prefix: index_
        period: 24h

storage_config:
 tsdb_shipper:
   active_index_directory: /loki/index
   cache_location: /loki/index_cache
   cache_ttl: 24h    # Can be increased for faster performance over longer query periods, uses more disk space
 aws:
   s3: s3://<region>/<bucket_name>
   s3forcepathstyle: true
   # If deployed on EC2, it is recommended to use the `EC2 instance role`.
   access_key_id: <access_key_id>
   secret_access_key: <secret_access_key>


The role should have a policy with the following permissions attached.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "LokiStorage",
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:PutObject",
                "s3:GetObject",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::<bucket_name>",
                "arn:aws:s3:::<bucket_name>/*"
            ]
        }
    ]
}


Promtail

# usermod -aG docker promtail
Last modified: December 31, 2025

Comments

Write a Reply or Comment

Your email address will not be published.