LOKI

Grafana Loki is a system for collecting, storing, and analyzing logs. It uses label-based indexing and supports log queries and visualization through the Grafana web interface. Default configuration file path: /opt/dppm/planr/logging/loki/local-config.yaml

auth_enabled: false

server:
  http_listen_port: 3100

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

schema_config:
  configs:
  - from: 2020-05-15
    store: tsdb
    object_store: filesystem
    schema: v13
    index:
      prefix: index_
      period: 24h

limits_config:
  ingestion_rate_strategy: local # Default: global
  max_global_streams_per_user: 5000
  max_query_length: 0h # Default: 721h
  max_query_parallelism: 32 # Old Default: 14
  max_streams_per_user: 0 # Old Default: 10000
  retention_period: 168h # 1 weeks retantion

auth_enabled: false

  • auth_enabled enables or disables authentication when accessing Loki.

server

  • This section configures the HTTP server used by Loki;
  • http_listen_port: 3100 — specifies the port on which Loki listens for incoming HTTP requests. The default is 3100.

common

  • This section defines general Loki settings, such as file paths and replication;
  • path_prefix: /loki — specifies the base path for storing Loki data and configuration;
  • storage defines how and where data is stored:
  • chunks_directory: /loki/chunks — specifies the directory for storing logs as chunks;
  • rules_directory: /loki/rules — specifies the directory for storing rules, such as alerting or log processing rules;
  • replication_factor: 1 — specifies the data replication factor. In this example, replication is disabled, and only one copy of the data is stored;
  • ring — configures the ring responsible for distributing workloads and data across cluster nodes;
  • kvstore: inmemory — stores ring data in memory without writing it to disk. This is suitable for small deployments and testing.

schema_config

  • This section configures the Loki storage schema;
  • from: 2020-05-15 — specifies the date from which this schema applies;
  • store: tsdb — specifies that Loki uses TSDB (Time Series Database) for data storage;
  • object_store: filesystem — specifies object storage on the local file system;
  • schema: v13 — specifies the schema version. Recent Loki versions use v13 for optimized data storage;
  • index:
  • prefix: index_ — specifies the index prefix. Logs are indexed to speed up searches;
  • period: 24h — specifies the indexing period, with indexes reset every 24 hours.

limits_config

  • This section defines system limits and workload settings;
  • ingestion_rate_strategy: local — specifies the ingestion rate limiting strategy. The local strategy applies limits to individual nodes rather than globally;
  • max_global_streams_per_user: 5000 — specifies the maximum number of streams a user can open across the cluster;
  • max_query_length: 0h — specifies the maximum query duration. A value of 0h means there is no time limit;
  • max_query_parallelism: 32 — specifies the maximum number of queries that can run in parallel;
  • max_streams_per_user: 0 — specifies the maximum number of streams per user. A value of 0 means there is no limit;
  • retention_period: 168h — specifies how long logs are retained before deletion. 168 hours equals 7 days (1 week).

For more information about configuring Loki, see the official documentation: https://grafana.com/docs/loki/latest/configure/


608.0-5d1f26c7