Hello,
I’m trying to configure Loki and the compactor on my on-premise cluster. However, I’m facing an issue where logs are being deleted after only a few hours, despite setting the retention period to 5 days. I can’t seem to understand why logs aren’t staying beyond 24 hours.
Below is the ConfigMap YAML configuration for Loki. Could someone kindly help me identify the cause?
apiVersion: v1
data:
config.yaml: |2
auth_enabled: false
bloom_build:
builder:
planner_address: loki-backend-headless.konv-monitor.svc.cluster.local:9095
enabled: false
bloom_gateway:
client:
addresses: dnssrvnoa+_grpc._tcp.loki-backend-headless.konv-monitor.svc.cluster.local
enabled: false
chunk_store_config:
chunk_cache_config:
background:
writeback_buffer: 500000
writeback_goroutines: 1
writeback_size_limit: 500MB
default_validity: 0s
memcached:
batch_size: 4
parallelism: 5
memcached_client:
addresses: dnssrvnoa+_memcached-client._tcp.kl-loki-chunks-cache.konv-monitor.svc
consistent_hash: true
max_idle_conns: 72
timeout: 2000ms
common:
compactor_address: 'http://loki-backend:3100'
path_prefix: /var/loki
replication_factor: 3
storage:
s3:
access_key_id: loki
bucketnames: chunks
endpoint: http://loki:lokiloki@192.168.81.179:9000/loki
insecure: false
s3forcepathstyle: true
secret_access_key: lokiloki
compactor:
compaction_interval: 10m
delete_request_store: aws
retention_delete_delay: 24h
retention_delete_worker_count: 150
retention_enabled: true
working_directory: /var/loki/retention
frontend:
scheduler_address: ""
tail_proxy_url: ""
frontend_worker:
scheduler_address: ""
index_gateway:
mode: simple
limits_config:
max_cache_freshness_per_query: 10m
max_query_length: 2161h
max_query_lookback: 720h
query_timeout: 300s
reject_old_samples: true
reject_old_samples_max_age: 480h
retention_period: 5d
split_queries_by_interval: 15m
volume_enabled: true
memberlist:
join_members:
- loki-memberlist
pattern_ingester:
enabled: false
query_range:
align_queries_with_step: true
cache_results: true
results_cache:
cache:
background:
writeback_buffer: 500000
writeback_goroutines: 1
writeback_size_limit: 500MB
default_validity: 12h
memcached_client:
addresses: dnssrvnoa+_memcached-client._tcp.kl-loki-results-cache.konv-monitor.svc
consistent_hash: true
timeout: 500ms
update_interval: 1m
ruler:
storage:
s3:
access_key_id: loki
bucketnames: ruler
endpoint: http://loki:lokiloki@192.168.81.179:9000/loki
insecure: false
s3forcepathstyle: true
secret_access_key: lokiloki
type: s3
runtime_config:
file: /etc/loki/runtime-config/runtime-config.yaml
schema_config:
configs:
- from: "2020-07-01"
index:
period: 24h
prefix: index_
object_store: aws
schema: v13
store: tsdb
server:
grpc_listen_port: 9095
http_listen_port: 3100
http_server_read_timeout: 600s
http_server_write_timeout: 600s
storage_config:
bloom_shipper:
working_directory: /var/loki/data/bloomshipper
boltdb_shipper:
index_gateway_client:
server_address: dns+loki-backend-headless.konv-monitor.svc.cluster.local:9095
filesystem: {}
hedging:
at: 250ms
max_per_second: 20
up_to: 3
tsdb_shipper:
active_index_directory: /var/loki/tsdb/index
cache_location: /var/loki/tsdb/index_cache
cache_ttl: 1m
index_gateway_client:
server_address: dns+loki-backend-headless.konv-monitor.svc.cluster.local:9095
tracing:
enabled: false
kind: ConfigMap