# =============================================================================
# Loki Configuration for RE Workflow
# =============================================================================

auth_enabled: false

server:
  http_listen_port: 3100
  grpc_listen_port: 9096
  log_level: info

common:
  instance_addr: 127.0.0.1
  path_prefix: /loki
  storage:
    filesystem:
      chunks_directory: /loki/chunks
      rules_directory: /loki/rules
  replication_factor: 1
  ring:
    kvstore:
      store: inmemory

# Query range settings
query_range:
  results_cache:
    cache:
      embedded_cache:
        enabled: true
        max_size_mb: 100

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

# Ingestion limits
limits_config:
  retention_period: 15d                    # Keep logs for 15 days
  ingestion_rate_mb: 10                    # 10MB/s ingestion rate
  ingestion_burst_size_mb: 20              # 20MB burst
  max_streams_per_user: 10000              # Max number of streams
  max_line_size: 256kb                     # Max log line size
  max_entries_limit_per_query: 5000        # Max entries per query
  max_query_length: 721h                   # Max query time range (30 days)

# Compactor for retention
compactor:
  working_directory: /loki/compactor
  retention_enabled: true
  retention_delete_delay: 2h
  delete_request_store: filesystem
  compaction_interval: 10m

# Ruler configuration (for alerting)
ruler:
  alertmanager_url: http://alertmanager:9093
  storage:
    type: local
    local:
      directory: /loki/rules
  rule_path: /loki/rules-temp
  enable_api: true

# Table manager (for index retention)
table_manager:
  retention_deletes_enabled: true
  retention_period: 360h  # 15 days

# Analytics (optional - disable for privacy)
analytics:
  reporting_enabled: false

