I’ve been tinkering around a couple of days with my Loki setup handling logs through promtail and using s3 for long term backups of the kubernetes logs.
I’m a bit confuse since the two places I’ve found referencing to that says that Loki will by default not have a retention period set, implying that it will store them forever.
Is my interpretation correct? Is this even true with recent v11 tsdb and S3 as backend?
I’m installing loki-stack through helm chart, which means the loki final config after templating is as folows
auth_enabled: false
chunk_store_config:
max_look_back_period: 0s
compactor:
retention_enabled: true
shared_store: s3
working_directory: /data/loki/boltdb-shipper-compactor
ingester:
chunk_block_size: 262144
chunk_idle_period: 3m
chunk_retain_period: 1m
lifecycler:
ring:
replication_factor: 1
max_transfer_retries: 0
wal:
dir: /data/loki/wal
limits_config:
enforce_metric_name: false
ingestion_burst_size_mb: 24
ingestion_rate_mb: 50
max_entries_limit_per_query: 5000
max_global_streams_per_user: 10000
per_stream_rate_limit: 10MB
reject_old_samples: true
reject_old_samples_max_age: 168h
memberlist:
join_members:
- 'loki-memberlist'
schema_config:
configs:
- from: "2023-01-05"
index:
period: 24h
prefix: index_
object_store: s3
schema: v11
store: tsdb
server:
grpc_listen_port: 9095
grpc_server_max_recv_msg_size: 54857600
grpc_server_max_send_msg_size: 54857600
http_listen_port: 3100
storage_config:
aws:
bucketnames: k8s-longterm-logs
s3forcepathstyle: false
boltdb_shipper:
active_index_directory: /data/loki/boltdb-shipper-active
cache_location: /data/loki/boltdb-shipper-cache
cache_ttl: 24h
shared_store: filesystem
filesystem:
directory: /data/loki/chunks
tsdb_shipper:
active_index_directory: /data/loki/index
cache_location: /data/loki/index_cache
cache_ttl: 24h
table_manager:
retention_deletes_enabled: false
retention_period: 0s
As you can see, the helm chart templates on loki-stack still populates some boltdb entries, which I’m not 100% are used at all, but I’m more worried about the remaining config parameters being compatible with my needs.
I need to use s3 as data backend since almost everything else gets destroyed and recreated eventually, meaning s3 is the only thing I can trust for long term availability.
On the same direction, do you know if once loki objects are uploaded into S3, those files are susceptible to modification or deletion, assuming a “infinite time retention” ?