Portal Community

Microservices Components

ComponentRoleScales With
DistributorReceives log pushes; validates; fans out to ingesters via hash ringIngest rate (logs/second)
IngesterBuffers logs in WAL; flushes chunks to object storageActive stream count + ingest rate
Query FrontendSplits large queries into shards; caches results; queuesQuery concurrency
QuerierExecutes LogQL against object storage and ingester cachesQuery parallelism
CompactorCompacts chunks; enforces retention; manages indexSingle instance (usually)
RulerEvaluates alerting rules against Loki dataAlert rule count

Kubernetes Helm Deployment (Loki Distributed)

# Add Grafana Helm repo (if not already done):
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

# Install Loki in distributed mode:
helm install loki grafana/loki-distributed \
  --namespace observe \
  --values loki-distributed-values.yaml

# loki-distributed-values.yaml:
loki:
  auth_enabled: true         # Multi-tenancy required for enterprise
  storage:
    type: s3
    s3:
      endpoint: s3.amazonaws.com
      region: us-east-1
      bucketnames: bizfirst-loki-chunks
      access_key_id: ${AWS_ACCESS_KEY}
      secret_access_key: ${AWS_SECRET_KEY}

ingester:
  replicas: 3                # 3 ingesters for write HA
  persistence:
    enabled: true
    size: 10Gi

distributor:
  replicas: 2                # 2 distributors for ingest HA

querier:
  replicas: 2                # 2 queriers for query parallelism

queryFrontend:
  replicas: 2

compactor:
  enabled: true
  serviceAccount:
    create: true

Scaling Guidelines

Daily Log VolumeIngestersQueriersDistributors
< 10 GB/day1 (single-binary)11
10–50 GB/day322
50–200 GB/day643
> 200 GB/day12+8+6+
Ingester Ring Requires Coordination

Loki ingesters use a consistent hash ring to distribute stream ownership. When scaling ingesters up or down, the ring rebalances automatically — but rapid scaling changes can cause brief ingestion gaps. Scale gradually (add 1-2 ingesters at a time) and wait for the ring to stabilize (check loki_ring_members metric) before scaling further.