- What Grafana loki version and what operating system are you using?
loki, version 2.9.4 on RHEL 8
- What are you trying to achieve?
Everything is working fine.
- How are you trying to achieve it?
I’ve set up separate hosts for Grafana Loki and Grafana, and their integration is functioning well. However, I’m still unsure about Loki’s log retention. Despite the configuration file specifying a retention period of ‘period: 24h’, I’m seeing old logs persisting. Can you help clarify the following?
1-Could you explain the purpose of these directories?
filesystem:
chunks_directory: /grafanaloki/loki/chunks
rules_directory: /grafanaloki/loki/rules
2-In the schema configuration:
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
What does ‘24h’ signify here?
3- If I aim to retain logs for only 60 days, what adjustments should I make to the configuration?
Thank you
- Can you copy/paste the configuration(s) that you are having problems with?
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
common:
instance_addr: 127.0.0.1
path_prefix: /grafanaloki/loki
storage:
filesystem:
chunks_directory: /grafanaloki/loki/chunks
rules_directory: /grafanaloki/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 100
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
ruler:
alertmanager_url: http://localhost:9093
query_scheduler:
max_outstanding_requests_per_tenant: 4096