Certainly, let's delve into your Loki configuration file line by line, focusing on data storage and retention mechanisms for both local filesystem and Amazon S3:
🔐 Authentication
auth_enabled: falseDisables authentication, allowing unrestricted access to Loki's endpoints
🌐 Server Configuration
server:
http_listen_port: 3100
grpc_listen_port: 9096
log_level: debug
grpc_server_max_concurrent_streams: 1000-
http_listen_port Loki's HTTP API listens on port 310.
-
grpc_listen_port gRPC services are available on port 909.
-
log_level Set to 'debug' for verbose logging, useful during development or troubleshootin.
-
grpc_server_max_concurrent_streams Allows up to 1000 concurrent gRPC streams, accommodating high-throughput scenario.
🧱 Common Configuration
common:
instance_addr: 127.0.0.1
path_prefix: /tmp/loki
storage:
filesystem:
chunks_directory: /tmp/loki/chunks
rules_directory: /tmp/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory-
*instance_addr: Binds the Loki instance to localhot.
-
*path_prefix: Base directory for storing Loki's data and configuratios.
-
*storage.filesystem: Specifies directories for storing log chunks and rule files localy.
-
*replication_factor: Set to 1, indicating no replication; suitable for single-node setus.
-
*ring.kvstore.store: Uses in-memory key-value store for ring management, appropriate for non-distributed environmens.
🔍 Query Range Configuration
query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 100-
*results_cache: Enables caching of query results to improve performace.
-
*embedded_cache: Activates an in-memory cache with a maximum size of 100MB.
📅 Retention Policy
limits_config:
retention_period: 24h- retention_perio: Specifies that logs older than 24 hours should be delted
Note: To enforce this retention policy, ensure that the compactor is properly configured and that the object store (e.g., S3) has appropriate lifecycle poliies. citeturn0search0
☁️ Storage Configuration
storage_config:
tsdb_shipper:
resync_interval: 30m # Upload data to S3 every 30 minutes
aws:
s3: s3://ap-south-1
bucketnames: lokiapr142024-
tsdb_shipper.resync_interva: Sets the interval at which Loki synchronizes index data with the object store (S3) every 30 mintes.
-
aws.s: Specifies the S3 endpoint and bucket name for storing ogs
This configuration ensures that logs are initially stored locally and then uploaded to S3 at the defined inteval.
🗂️ Schema Configuration
schema_config:
configs:
- from: 2020-07-01
store: tsdb
object_store: s3
schema: v13
index:
prefix: index_
period: 24h-
frm: Indicates the start date for this schema configurtion.
-
stoe: Uses TSDB (Time Series Database) for indexing, which is efficient for time-seriesdata.
-
object_stoe: Specifies S3 as the object store for log cunks.
-
schea: Uses version 13 of the schema, which supportsTSDB.
-
index.prefx: Sets the prefix for index iles.
-
index.perid: Defines the duration of each index file; here, it's set to 24 our.
This configuration directs Loki to store logs locally and then ship them to S3, with indexing handled byTSDB.
📊 Pattern Ingester Configuration
pattern_ingester:
enabled: true
metric_aggregation:
loki_address: localhost:3100-
enabed: Activates the pattern ingester, which processes log patterns for metric aggreation.
-
metric_aggregation.loki_addrss: Specifies the Loki instance address for metric aggreation.
⚠️ Ruler Configuration
ruler:
alertmanager_url: http://localhost:9093- alertmanager_rl: Points to the Alertmanager instance for handling alerts generated by Loki's ruler comonent.
🧑💻 Frontend Configuration
frontend:
encoding: protobuf- encding: Uses Protocol Buffers for encoding data between frontend and backend components, which is efficient andcompact.
🧹 Compactor Configuration
compactor:
working_directory: /tmp/loki/compactor
retention_enabled: true
retention_delete_delay: 10m
retention_delete_worker_count: 2
delete_request_store: filesystem-
working_dirctory: Specifies the directory for compactor oerations.
-
retention_eabled: Enables the compactor to enforce retentionpolicies.
-
retention_deletedelay: Sets a delay before deletion of expired data, allowing for potentialrecovery.
-
retention_delete_workercount: Defines the number of workers handling deleton tasks.
-
delete_requeststore: Specifies the storage backend for