Self-hosting. Grafana Loki

ΠŸΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ‚ Π²Ρ‹ΠΏΠΎΠ»Π½ΡΡ‚ΡŒ сбор Π΄Π°Π½Π½Ρ‹Ρ… Π»ΠΎΠ³ΠΎΠ² для дальнСйшСго Π°Π½Π°Π»ΠΈΠ·Π° с Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… систСм.

ΠžΡ„ΠΈΡ†ΠΈΠ°Π»ΡŒΠ½Ρ‹ΠΉ сайт: Grafana Loki OSS | Log aggregation system

ΠŸΡ€ΠΈΠΌΠ΅Ρ€ docker compose Ρ„Π°ΠΉΠ»Π°:

services:
  loki:
    image: grafana/loki:latest
    container_name: loki
    ports:
      - 3100:3100
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./loki-config.yml:/etc/loki/loki-config.yaml
      - loki_data:/loki
    networks:
      - monitoring
    labels:
      org.label-schema.group: monitoring
    restart: unless-stopped
    
volumes:
  loki_data:
networks:
  monitoring:
    name: monitoring
    external: true

Π€Π°ΠΉΠ» ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ:

Loki

auth_enabled: false

server:
  http_listen_port: 3100
  grpc_listen_port: 9095

ingester:
  wal:
    dir: "/tmp/wal"
  lifecycler:
    address: 127.0.0.1
    ring:
      kvstore:
        store: inmemory
      replication_factor: 1
  chunk_idle_period: 5m
  chunk_retain_period: 30s
  chunk_target_size: 1536000
  chunk_block_size: 262144

schema_config:
  configs:
    - from: 2023-01-01
      store: tsdb
      object_store: filesystem
      schema: v13
      index:
        prefix: index_
        period: 24h

storage_config:
  tsdb_shipper:
    active_index_directory: /loki/index
    cache_location: /loki/index_cache
    cache_ttl: 24h

compactor:
  working_directory: /loki/compactor

limits_config:
  reject_old_samples: true
  reject_old_samples_max_age: 168h

chunk_store_config:

table_manager:
  retention_deletes_enabled: true
  retention_period: 168h

ruler:
  storage:
    type: local
    local:
      directory: /loki/rules
  rule_path: /loki/rules
  ring:
    kvstore:
      store: inmemory
  enable_api: true

Настройка: